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; }
source share