We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to customize the Nested Grid style in the GridDataControl?

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.

 

C#

 

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.

 

C#

 

The following code example illustrates how to customize the style of Header Row and RowHeader for child grid in the QueryCellInfo event.

 

C#

 

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.

Sample Link: StyleForNesedGrid_WPF

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
3786 02/09/2015 07/10/2015 WPF GridDataControl 4.5 12.4.0.24
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.