windows forms datagridview doesn't sort automatically

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
 
J

Jack Jackson

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.
 
B

BillE

I did find some examples of adding sorting to a BindingList, but it seems
easier just to use datasets.

Thanks.
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top