Skip to content

SyncfusionExamples/How-to-resize-parent-grid-columns-to-automatically-adjust-child-grid-columns-in-GridGroupingControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

How to resize parent grid columns to automatically adjust child grid columns in WinForms GridGroupingControl?

In WinForms GridGroupingControl, when resizing a parent grid column, the corresponding child grid columns can also be resized based on the parent column width by using the TableModel.ColWidthsChanging event. Within this event, the widths of the nested table columns can be adjusted proportionally to reflect the changes made to the parent column.

//Event subscription
gridGroupingControl1.TableModel.ColWidthsChanging += OnColWidthsChanging;

//Event customization
private void OnColWidthsChanging(object sender, GridRowColSizeChangingEventArgs e)
{
   int col = e.From;
   GridTable table1 = this.gridGroupingControl1.GetTable("ChildTable");
   table1.TableModel.ColWidths[col - 1] = Convert.ToInt32(e.Values.GetValue(0));     
}

Resize the child columns based on parent grid columns

Take a moment to peruse the WinForms GridGroupingControl - Columns documentation, to learn more about managing records and columns with examples.

About

This demo shows how to resize parent grid columns to automatically adjust child grid columns in GridGroupingControl.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages