[SOLVED] DataGridViewColumn sort disable

Answered Closed
0
0

I want to disable sorting for all columns but ,it’s not work
for (int i = 0; i < this.Columns.Count; i++)
{
this.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}

 

  • You must to post comments
Best Answer
0
0

Hi,

issue #2111 is fixed in the latest Wisej build (2.1.22).

Best regards
Frank

  • You must to post comments
0
0

Hi HSoft,

The issue has been fixed and will be available in the next development build!  We’ll let you know when it’s out.

Best,

Levie

  • You must to post comments
0
0

Hi HSoft,

Thanks for reporting the issue. I’ve logged it as #2111.

 

You can add this line to your code as a temporary workaround:

for (int i = 0; i < dataGridView1.Columns.Count; i++)

{

dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;

dataGridView1.Columns[i].Update();

}

Let me know if this works for you.

Best,
Levie

  • You must to post comments
Showing 3 results