Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataGridView.GetCellDisplayText(Int32, String) Method

Gets the text displayed within the specified cell.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

#Declaration

C#
public string GetCellDisplayText(
    int rowHandle,
    string fieldName
)

#Parameters

Name Type Description
rowHandle Int32

The handle of the row that contains the cell.

fieldName String

The field name of the column that contains the cell.

#Returns

Type Description
String

A string displayed within the specified cell.

#Remarks

Use the GetCellDisplayText method to obtain a textual representation of the specified cell value. The returned string is formatted as specified by the GridColumn.DisplayFormat property of the column to which the specified cell belongs. If you need to obtain the actual cell value, use the DataGridView.GetCellValue method instead.

The GetCellDisplayText method returns an empty string in the following cases:

  • the specified row handle does not point to any of the rows within the grid or points to a group row;
  • the grid does not contain a column with the specified field name.
See Also