DataGridViewColumnCollection::GetColumnCount Method (DataGridViewElementStates)

 

Returns the number of columns that meet the given filter requirements.

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

public:
int GetColumnCount(
	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 number of columns that meet the filter requirements.

Exception Condition
ArgumentException

includeFilter is not a valid bitwise combination of DataGridViewElementStates values.

The following code example illustrates how to use this method to get the number of selected columns.

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

.NET Framework
Available since 2.0
Return to top
Show: