Home > Back-end >  winform datagridview column sort
winform datagridview column sort

Time:10-01

I'm trying to sort a column in a standard windows forms datagridview.

Visual Studio 2015 Target .net Framework: 4.5.2

I've set AllowUsersToOrderColumns to True. All columns have SortMode set to Automatic. My data source is a BindingList of objects. All columns have the DataPropertyName set. The grid loads and displays fine. I don't see the up/down arrow and clicking the column header does nothing. Do I have to implement some code? I thought this was default behavior. What am I missing please?

Thank you.

CodePudding user response:

Both answers above are correct. I've also found another article that points to code that converts a list to a "SortableBindingList". Of course you can change the class name if you like. Look at the marked answer in

Sortable List

  • Related