How can I get my bindSource to support sorting?

I am trying to create a master-details form, with master records bound to one binding source, and datagridview details bound to a second binding source

This works very well, only the childBindingSource.SupportSorting property is false. masterBindingSource.SupportsSorting true. Is there a way to get childBindingSource to support sorting - given that it is based on another binding source that supports sorting?

 masterBindingSource.DataSource = GetBindingSource() // .SupportsSorting = true childBindingSource.DataSource = masterBindingSource // .SupportsSorting = false childBinding.DataMember = ChildItems private BindingSource GetBindingSource() { DbSet<ContactEvent> dset = Db.ContactEvents; IOrderedQueryable<ContactEvent> qry = dset.Where(p => p.Id > 0).OrderBy(x => x.Id); qry.Load(); BindingList<ContactEvent> bindinglist = dset.Local.ToBindingList(); var bindingSource = new BindingSource(); bindingSource.DataSource = bindinglist; return bindingSource; } 
+4
source share
1 answer

With some help, we got this working using this link in codeplex

I had to change my class to use SortableBindingList instead of BindingList. I was wondering that only the BindingList is good enough for a grid at the master level, but not for a grid containing parts.

+1
source

All Articles