I'm using a Windows Forms DataGridView to display a generic list of MyObject
objects.
First of all I wrap this collection into a BindingSource
Collection, then:
dataGridView.DataSource = myBindingSource;
What I want to do is allow the user to sort the columns by clickin on the header of the column representing a concrete Property in MyObject.
I've read some articles that I should do sorting before binding. But it does not help me if I want to sort the columns in real time, being said when it's already binded.
The question is, what exactly do I need to do, so I could see the sorting arrows in DataGridView and I could sort every column ?
dataGridView.DataSource = new BindingListView<MyObject>(myObjects.ToList())
with the library at sourceforge.net/projects/blw. – Pat