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. SizeColumnAuto Customizing
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 DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlGridView - Get Started in C#GridView - PropertiesGridView - ColumnColumn - TypesData ColumnBrowse ColumnCalculator ColumnCheckBox ColumnColor ColumnComboBox ColumnCommand ColumnDataTime ColumnDecimal ColumnHyperLink ColumnImage ColumnMaskBox ColumnMultiComboBox ColumnTextBox ColumnColumn - Generating ColumnsAccess & Iterate through ColumnsColumn - ReorderColumn - ResizeColumn - Pin & UnpinColumn - Column ChooserColumn - Data FormattingColumn - Convert Data TypesGridView - RowGridView - CellsGridView - EditorsGridView - Context MenuGridView - Populating with DataGridView - Hierarchical GridGridView - SelectionGridView - ScrollingGridView - SortingGridView - GroupingGridView - FilteringGridView - Expression EditorInsert/ Update/ Delete RecordsGridView - View DefinitionGridView - Exporting DataStyling and AppearanceGridView - LocalizationSave and Load LayoutGridView - Print SupportWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |