C# 3.5 datagridview column header click does not sorts
I have winform there开发者_JS百科 is datagridview control when i click on column header it does not sorts. Can anyone advice me whats wrong?
Each column has "SortMode" property in datagridview control. SortMode Values : Automatic, NotSortable, Programmatic You could check SortMode property.
private void dataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
e.Column.SortMode = DataGridViewColumnSortMode.NotSortable;
}
精彩评论