hi ,my code is like that
dataGridView1.Sort(nameDataGridViewTextBoxColumn, ListSortDirection.Ascending);
dataGridView1.Sort(levelDataGridViewTextBoxColumn, ListSortDirection.Ascending);
for (int i = 0; i < dgvMainGrid.ColumnCount; i++)
{
dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
i hope that it can sort first by level,if the level is the same,then by name
like
name level
bbb 1
zzz 1
aaa 2
fff 2
but i found it is only sorted by level
could anyone can do me a favor to help me?
btw,i use ( dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;) for forbidden the user in runtime to sort
thank u very much in advance
best regards
martin