FirstByte
FirstByte

Reputation: 631

winform datagridview column sort

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.

Upvotes: 0

Views: 807

Answers (1)

FirstByte
FirstByte

Reputation: 631

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

Upvotes: 3

Related Questions