How to: Enable Row Preview Sections in a Grid List Editor
- 2 minutes to read
Grid List Editors can display lengthy memo fields in Row Preview Sections. Use the PreviewColumnName property to enable this feature. This property allows you to select one of the columns from the Columns collection.
When the DataAccessMode property is DataView
, a list view uses only visible columns to display data in the Row Preview Sections. To customize this behavior, use the CustomizeDisplayableProperties event.
The instructions below customize the Note List View. Follow these instructions to enable Row Preview Sections and populate them with values of the Note.Text
property.
Note
To follow the steps below, you can use the MainDemo application installed as a part of the XAF package. The default location of the application is %PUBLIC%\Documents\DevExpress Demos 24.2\Components\XAF.
This application’s DemoTask List View initially displays Preview Sections populated with values of the DemoTask.Description
property.
In the Solution Explorer, go to the MainDemo.Module project and double-click the Model.DesignedDiffs.xafml file to open it in the Model Editor.
Navigate to the Views | MySolution.Module.BusinessObjects | Note | Note_ListView node.
Set the PreviewColumnName property to
Text
.Navigate to the Views | MySolution.Module.BusinessObjects | Note | Note_ListView | Columns | Text node.
Set the
Index
property to-1
. This hides the Text column from a grid. So, the column values are only displayed in a Row Preview Section.Run the application. Navigate to the Note List View to see the preview section.