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

ColumnView.GetFocusedRowCellDisplayText(String) Method

Gets the display value of the specified cell in the focused row.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

public string GetFocusedRowCellDisplayText(
    string fieldName
)

#Parameters

Name Type Description
fieldName String

A string identifying the field name of the column which contains the required cell. A ArgumentNullException exception will be thrown if the current View does not contain a column with the specified field name.

#Returns

Type Description
String

A string representing the text displayed within the specified column in the focused row.

#Remarks

Use the GetFocusedRowCellDisplayText method to obtain a textual representation of a specific cell’s value. The returned string is formatted as specified by the GridColumn.DisplayFormat property of the column in which the specified cell resides. To obtain the cell’s actual value use the ColumnView.GetRowCellValue.

If a group row is focused this method returns an empty string.

The currently focused row is determined by the ColumnView.FocusedRowHandle property.

To get the text displayed within the focused cell, the ColumnView.GetFocusedDisplayText method can be used. The ColumnView.GetRowCellDisplayText method can be used to retrieve the displayed values of any cell in a View.

Note

Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetFocusedRowCellDisplayText member must not be invoked for these Views. The GetFocusedRowCellDisplayText member can only be used with Views that display real data within the Grid Control. Use the following methods to access these Views with which an end user interacts at runtime.

See Also