This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, It is possible to retreive an EntityCollection from a UnitOfWork instead of a Ilist ou IEnumerable. With an EntityCollection, this is possible to get events like EntityAdded and EntityRemoved. I want to create my own custom data binding with an Infragistics grid but I need to know when an item is added or removed to the list to automatically refresh the grid with the new data. The only solution that I found is use a repository pattern that wrap the add and delete method of IList and then raise event from the repository. The problem is that subCollection generated by the model of your visual designer used EntityCollection and for this reason, I must listen EntityAdded event from EntityCollection is some cases and from repository in other cases. What do you suggest? Thank you. |
|
|
It is not possible with LINQ. It is possible with the core API by using the Find overload that returns into a BindingList: BindingList<Widget> widgets = new BindingList<Widget>(); You should use BindingList rather than EntityCollection because EntityCollection expects to have an underlying association which is not the case for a top-level list. BindingList is the base class of EntityCollection and provides a ListChanged event which does what you need. Note however that BindingList does not have all the semantics of EntityCollection: in particular, adding an item to a BindingList does not add it to the UOW. We are considering making our results BindingLists by default, precisely to facilitate data binding, but we don't have any definite plans around this. |
|
|
NeoSynergix- We use Infragistics grids and bind as Ivan illustrated. It works well enough for us and we've not experience any troubles. Hope this helps. Lionel |
|