This sample demonstrates how you can customize the appearance of nested tables in a hierarchical data set through the designer.
Features:
This sample is built with a hierarchical data set with two tables that have been customized at design-time.
Apply style settings to a nested table through the designer using the Appearance.NestedTableCell property on the instances of a Grid Grouping control.
This property will let you take control of all aspects of the appearance of nested table cells such as cell background color, text color, value, and font.
Properties such as Appearance.NestedTableRowHeaderCell and Appearance.NestedTableIndentCell can be used to set row header styles and indent the cells of nested tables
Also set styles through code:
The table descriptor of the nested table should be retrieved.
Format the cells of the nested table using the Appearance property.
// Formatting nested table cells. this.gridGroupingControl1.Appearance.NestedTableCell.Interior = new Syncfusion.Drawing.BrushInfo (System.Drawing.Color.FromArgb(((System.Byte)(206)), ((System.Byte)(213)), ((System.Byte)(231)))); // Formatting nested table row headers. this.gridGroupingControl1.Appearance.NestedTableRowHeaderCell.Interior = new Syncfusion.Drawing.BrushInfo (Syncfusion.Drawing.GradientStyle.Horizontal,System.Drawing.SystemColors.Window, System.Drawing.Color.FromArgb(((System.Byte)(133)),((System.Byte)(191)),((System.Byte)(117)))); this.gridGroupingControl1.Appearance.NestedTableRowHeaderCell.Themed = false;
You can also set the styles through code.
The first step is that the table descriptor of the nested table should be retrieved.
GridTableDescriptor gtd=this.gridGroupingControl1.GetTableDescriptor("Orders");
The second step is to format the cells of the nested table by using the Appearance property.
gtd.Appearance.AddNewRecordFieldCell.BackColor=Color.FromArgb(255,228,221); gtd.Appearance.AnyRecordFieldCell.BackColor=Color.FromArgb(223,247,252);
Given below is a sample illustration.