The GridDataControl provides support to customize the style for the nested grid by using QueryCellInfo event. The following screenshot illustrates the default appearance of the nested grid.
Figure 1: Default style of the Nested Grid
For customizing the styles of the nested grid, you can wire its QueryCellInfo event that is used to allow customization of each and every cell in the required format. You can wire the QueryCellInfo event for the child grid in the RecordExpanded event that gets triggered when the record is expanded.
Note: The QueryCellInfo event is invoked for each and every cell in the GridDataControl.
Refer to the following code example to wire the RecordExpanded event in the GridDataControl.
In the RecordExpanded event, you can access child models collection and wire the QueryCellInfo event of the child grid to customize the nested grid style. With the help of the ChildModels.TableProperties, you can also customize the entire child grid properties like DefaultHeaderRowHeight, AllowEdit, AllowDelete, etc.
The following code example illustrates how to wire the QueryCellInfo event and apply DefaultHeaderRowHeight for the child grid.
The following code example illustrates how to customize the style of Header Row and RowHeader for child grid in the QueryCellInfo event.
The above style has been applied to the child grid as shown in the following screenshot.
Figure 2: After customizing the Nested Grid’s Style
You can refer to the following sample link for customizing the nested grid style without applying the style of its parent grid.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|