Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When even I click on the column header an arrow displays and the list automatically gets reversed .

I need to disable that reversing in datagridview how to do this.
Posted
Comments
Vedat Ozan Oner 13-Mar-14 6:36am    
have you asked google?
AndrewCharlz 13-Mar-14 6:49am    
disable the header

1 solution

foreach (DataGridViewColumn column in dataGridView.Columns)
{
column.SortMode = DataGridViewColumnSortMode.NotSortable;
}
 
Share this answer
 
Comments
Member 11776570 11-Apr-18 11:27am    
But where to write this code. In which event of data grid view.
Member 14553482 7-Aug-19 15:59pm    
Place the code in DataBindingComplete event

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900