DataGridView::SortedColumn Property
Gets the column by which the DataGridView contents are currently sorted.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: [BrowsableAttribute(false)] property DataGridViewColumn^ SortedColumn { DataGridViewColumn^ get(); }
Property Value
Type: System.Windows.Forms::DataGridViewColumn^The DataGridViewColumn by which the DataGridView contents are currently sorted.
If the DataGridView is not sorted, this property will return null.
When the column indicated by this property has a SortMode property value of DataGridViewColumnSortMode::Automatic, it will display a sorting glyph based on the value of the SortOrder property.
When the column has a SortMode property value of DataGridViewColumnSortMode::Programmatic, you must display the sorting glyph yourself through the DataGridViewColumnHeaderCell::SortGlyphDirection property.
Note |
|---|
The value of this property is not meaningful when you sort the control using custom sorting. For more information about custom sorting, see the Sort(IComparer^) method and the SortCompare event. |
Available since 2.0
