SortedBindingList does not reflect changes in grid

SortedBindingList does not reflect changes in grid

Old forum URL: forums.lhotka.net/forums/t/3694.aspx


JonM posted on Thursday, October 11, 2007

I'm using CSLA.net 2.0 and a SortedBindingList to bind items to a grid.  When I programatically changes some of the business objects in my collection the changes are not updated in the grid.  Any ideas on this?  I think it has something to do with the SortedBindingList.  When I bind the straight business collection it works fine (except I can't sort without theSortedBindingList).  I've just bound the SortedBindingList to my DataGridView's datasource.  Any help would be great!

 

ajj3085 replied on Friday, October 12, 2007

Are you raising PropertyChanged events when the value is changed programatically?  Also, you may want to try putting a BindingSource between the grid and your list.

JonM replied on Friday, October 12, 2007

Yes I am raising the PropertyChanged event.  I know the BindingSource has been around for a while (.NET 2.0).  However, I'm now sure what I am supposed to do with it.

ajj3085 replied on Friday, October 12, 2007

Basically you set the BindingSource's DataSource to your SortedBindingList, and then set the grids datasource to the binding source.  You can hook up everything in the designer, and then in your code you just need one line of code to actually set the BindingSource's Datasource property.

Copyright (c) Marimer LLC