Eric's Blog

Day to day experience in .NET
Welcome to Blogs @ IRM Sign in | Join | Help
 Search

Disclaimer

The content of this site is my own personal opinion and does not in any way represent my employer, it's subsideries or affiliates. These postings are provided "AS IS" with no warranties, and confer no rights.

This Blog

Adding Objects to EntitySet<> does not Refresh Grid

I run into an issue with grids not showing newly added objects in one of my projects a couple of days ago. We use LINQ to SQL classes and the client is built according to the MVP pattern and what we want to do is of course to add child objects to the collections in the presenter class. The problem with this though is that the newly added object does not show up in the DataGridView. This came as a suprise to me since EntitySet<> exposes the ListChanged event which is all that should be necessary, but after some forum discussion and debugging in the BindingSource code this does not help if the class does not implement IBindingList which EntitySet<> does not.

Implementing IBindingList contains requirements on a lot of funtionallity like adding, deleting, sorting and so on so it could be a lot of work to implement that interface. I therefore added a suggestion on Microsoft Connect to do a refactoring of the IBindingList interface so that for example BindingSource could provide a better experince for more collections without increasing the burdon so much for the collection developers. Go to connect and vote for this!

Published den 21 mars 2008 10:48 by ericqu

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems