You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Fit the columns and rows size based on custom control size
2
+
2
3
This example demonstrates how to adjust the column and row height based on custom control size
4
+
5
+
When [WPF GridControl](https://help.syncfusion.com/wpf/gridcontrol/overview) is placed inside custom control and if you want to auto fit the row/column size of `GridControl` based on custom control resized position, then you can invoke [SizeChanged](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.sizechanged?view=netframework-4.8) event of `GridControl` and set the [RowHeights](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Grid.GridModel.html#Syncfusion_Windows_Controls_Grid_GridModel_RowHeights) and [ColumnWidths](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Grid.GridModel.html#Syncfusion_Windows_Controls_Grid_GridModel_ColumnWidths) property of [GridModel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Grid.GridModel.html) to the resized height/width.
6
+
7
+
```csharp
8
+
grid.SizeChanged+=grid_SizeChanged;
9
+
//To autofit the cells based on custom control resizing,
0 commit comments