Column Resizing in C#
The Kettic Data Grid control provides the support of column resizing to hold data. It is really easy to adjust the width of columns by dragging the column vertical grid line to desired size with mouse and then release your drag. If users of the Data Grid Control do not need resize the columns, they can easily disable the functionality in the Grid user interface for all columns by setting the property ApplyColumnResize to false or for a specific column by setting the property ApplyResize to false.
Resize Columns in C#
It is possible for users to change the column width for a particular one. No matter how narrow the width of the column is, it is able to hold some data. The Data Grid column offers the property Width to users to resize column. Furthermore, the two values, MinimumWidth and MaximumWidth, allow users to restrict the length of data for column. The following C# code snippet shows how to resize column.
Size Column Automatically
To size the column for data grid columns, users can use each of the two properties to achieve this, the SizeColumnAuto and AutoFit. The SizeColumnAuto property is able to fill the entire grid with columns by setting it to DataGridSizeColumnAuto.Fill. The AutoFit property is used to fit the grid with content columns. It requires each of the two methods, DataGridTemplate.AutoFitColumn or DataGridTemplate.AutoFit and can be performed by applying the context menu of the header cell and double click of the header edge.
The SizeColumnAuto property has various options available to customize the columns as specific requirements.
Events of Resizing Columns
The Kettic Data Grid Control offers the support of column resizing, which will fire the ColumnWidthChanging event when resizing the columns and will fire the ColumnWidthChanged when the resizing process completed.
UI Controlsfor Windows Forms.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls