SortGlyphDirection Property
Collapse the table of content
Expand the table of content

DataGridViewColumnHeaderCell::SortGlyphDirection Property

 

Gets or sets a value indicating which sort glyph is displayed.

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

public:
property SortOrder SortGlyphDirection {
	SortOrder get();
	void set(SortOrder value);
}

Property Value

Type: System.Windows.Forms::SortOrder

A SortOrder value representing the current glyph. The default is None.

Exception Condition
InvalidEnumArgumentException

The specified value when setting this property is not a valid SortOrder value.

InvalidOperationException

When setting this property, the value of either the OwningColumn property or the DataGridView property of the cell is null.

-or-

When changing the value of this property, the specified value is not None and the value of the SortMode property of the owning column is NotSortable.

This property is set automatically for columns with the SortMode property set to DataGridViewColumnSortMode::Automatic. You must set this property yourself when sorting by columns with the SortMode property set to DataGridViewColumnSortMode::Programmatic.

The following code demonstrates how to use the SortGlyphDirection property in a programmatic sort.

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft