I have a datagridview with some programmaticly sortable columns, the sorting itself is done on mouse click. I can get the gliph direction property but no glyph is displayed.
Any idea why?
private void gvRules_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
var column = gvRules.Columns[e.ColumnIndex];
var sortGlyphDirection = column.HeaderCell.SortGlyphDirection;
if (column.SortMode != DataGridViewColumnSortMode.Programmatic)
return;
switch (sortGlyphDirection)
{
case System.Windows.Forms.SortOrder.None:
case System.Windows.Forms.SortOrder.Ascending:
gvRules.Sort(column, ListSortDirection.Ascending);
break;
case System.Windows.Forms.SortOrder.Descending:
gvRules.Sort(column, ListSortDirection.Descending);
break;
default:
break;
}
}
found it:
needed to set column.SortMode programatic again