GridGroupingControl properties

This might seem silly.. But there are numerous properties for this control and they look overwhelming so I can't find exactly what I want (they should be definitely their but maybe I'm missing them). Like the columns how do I make them Fill option (like datagridview), and edit the properties of the header cells of each column. Thanks in advance!

1 Reply

SN Sindhu Nagarajan Syncfusion Team March 13, 2018 05:16 PM UTC

Hi Ali, 
 
Thanks for contacting Syncfusion support. 
 
Query 
Response  
Like the columns how do I make them Fill option (like datagridview) 
Suggestion1 
In GridGroupingcontrol, column width can be auto adjusted based on the grid width by setting AllowProportionalColumnSizing to True. Please refer to below code, 
 
Code Example  
this.gridGroupingControl1.AllowProportionalColumnSizing = true; 
 
Please refer the below UG link, 
 
Suggestion2 
Column width and row heights can be resized by using ResizeToFit() method. 
Code Example 
this.gridGroupingControl1.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Table()); 
this.gridGroupingControl1.TableModel.RowHeights.ResizeToFit(GridRangeInfo.Table()); 
 
Records present in the GridGroupingControl can be made to fit inside the column by using AutoFit property. Please ensure that WrapText property is set to False. 
 
Code Example 
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.WrapText = false; 
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.AutoFit = AutoFitOptions.Both; 
 Edit the properties of the header cells of each column 
In GridGroupingControl, headercell customization can be done by using ColumnHeaderCell property. Please make use of below code, 
 
Code Example 
this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.FontStyle = FontStyle.Italic; this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.Facename = "SegoeUI"; 
this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.Size = 15f; 
this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.TextColor = Color.Red;  
 
 
Please let us know if you have any other queries. 
 
Regards, 
Sindhu  


Loader.
Up arrow icon