windows forms datagridview doesn't sort automatically

  • Thread starter Thread starter BillE
  • Start date Start date
B

BillE

I'm building a windows forms application using vs2005, vb.net.

I have a form with a datagridview bound to a BindingSource.

Even though the Sortmode is set to Automatic for all columns, they do not
sort when the header is clicked.

Is this because of the type of datasource I am using?

How do I sort programmatically, if I can't sort automatically?

The Binding Source datasource is a class, which exposes a BindingList of
class objects.

Thanks
Bill
 
The BindingList(Of T) class does not implement sorting. If you search
the Internet you can find several examples of how to add sorting to
it.

I created my own class which subclasses BindingList, added sorting and
searching capabilities, then I use that class instead of BindingList.
 
I did find some examples of adding sorting to a BindingList, but it seems
easier just to use datasets.

Thanks.
Bill
 
Back
Top