Aland Li
Hi dafeizhu,
I have tested the code, the first column cannot be sorted, but the second column can be. It is because the SortMode property of the first column is NotSortable. We can set the SortMode property to Automatic have the column sortable. This is the code:
this.Column1.SortMode = DataGridViewColumnSortMode.Automatic;
Let me know if this helps.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.