GridView.GetRowPreviewDisplayText(Int32) Method
Gets the text displayed within a row’s preview section.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v21.2.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Grid
Declaration
Parameters
Name | Type | Description |
---|---|---|
rowHandle | Int32 | An integer value specifying the handle of the row whose preview section’s content is to be obtained. Row handles are not data source indexes, see the Accessing Rows in Code. Row Handles section of the “Rows” article for more information. |
Returns
Type | Description |
---|---|
String | A string value representing the text displayed within the specified preview section. |
Remarks
First, the GetRowPreviewDisplayText method tries to obtain the value of the field specified by the GridView.PreviewFieldName property. If the GridView.CalcPreviewText event is not handled, the method returns the value obtained. Otherwise, the method’s return value is the string specified by the event handler. An empty string if returned if the GridView.PreviewFieldName property value is not set and the GridView.CalcPreviewText event handler doesn’t provide any text.
The GetRowPreviewDisplayText method may be useful when custom painting preview sections. To do so, handle the GridView.CustomDrawRowPreview event.
Please refer to the Row Preview Sections topic for additional information.
Note
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetRowPreviewDisplayText member must not be invoked for these Views. The GetRowPreviewDisplayText 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.
- GridControl.MainView - returns the top most View in a grid;
- GridControl.FocusedView - returns the focused View;
- GridControl.DefaultView - returns the currently maximized View;
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.