When I click a column of the DataGridView control, the control sorts all the data according to the column.
Is it possible to disable this function? (Actually I want to select the whole column as in Excel or Word tables.)
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To disable sorting in the grid, all you need to is to set the
SortModeproperty of each column toDataGridViewColumnSortMode.NotSortable, like this:As for the full column selection, that functionality is not present. Making it work will need quite some work (if it is possible at all, which I doubt is anyways!).