Home › Forums › WinForms controls › Xceed Grid for WinForms › Programmatically AND manually sorting the columns. › Reply To: Programmatically AND manually sorting the columns.
oups! Missed a part of my code. The method should look like this:
private void dgParameters_SortedColumnsChanged(object sender, EventArgs e)
{
this.dgParameters.SortedColumnsChanged -= new EventHandler(dgParameters_SortedColumnsChanged);
Xceed.Grid.Column column = dgParameters.Columns[“group”];
if(column != null && column.SortDirection == SortDirection.None)
{
column.SortDirection = SortDirection.Ascending;
}
this.dgParameters.SortedColumnsChanged += new EventHandler(dgParameters_SortedColumnsChanged);
}
Imported from legacy forums. Posted by Peter (had 442 views)