DataGridViewColumnCollection::GetColumnsWidth Method (DataGridViewElementStates)
.NET Framework (current version)
Returns the width, in pixels, required to display all of the columns that meet the given filter requirements.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- includeFilter
-
Type:
System.Windows.Forms::DataGridViewElementStates
A bitwise combination of the DataGridViewElementStates values that represent the filter for inclusion.
Return Value
Type: System::Int32The width, in pixels, that is necessary to display all of the columns that meet the filter requirements.
| Exception | Condition |
|---|---|
| ArgumentException | includeFilter is not a valid bitwise combination of DataGridViewElementStates values. |
The following code example illustrates the use of this method. This example is part of a larger example available in How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control.
.NET Framework
Available since 2.0
Available since 2.0
Show: