DataGridViewColumnCollection::GetColumnsWidth Method (DataGridViewElementStates)

 

Returns the width, in pixels, required to display all of the columns that meet the given filter requirements.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
int GetColumnsWidth(
	DataGridViewElementStates includeFilter
)

Parameters

includeFilter
Type: System.Windows.Forms::DataGridViewElementStates

A bitwise combination of the DataGridViewElementStates values that represent the filter for inclusion.

Return Value

Type: System::Int32

The 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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: