EntityView2 / ListChanged / Entity Error

Posts   
 
    
thnk2wn
User
Posts: 31
Joined: 05-Jul-2008
# Posted on: 05-Jul-2008 21:20:34   

I am having a similar problem to below post, regarding ListChanged not being fired in EntityView2 when the error state changes for one of the entities it contains.

Related LGEN Thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7411&HighLight=1

We are using Infralution's VirtualTree control, and have it bound to an EntityView2<T>. The related post on their site is: http://www.infralution.com/phpBB2/viewtopic.php?t=1317&sid=59de94e9a6e31a795367f771b55eb9ec

Their control is reliant on ListChanged to get the error data to refresh. My question is, what is the best way to get ListChanged raised at the view level when the error state changes at the entity level?

We currently override SetEntityFieldError in our CommonEntityBase class so we should be able to detect when error state changes there. I suppose we could perhaps create some kind of EntityErrorStateChanged event in that class. Then, maybe we could create our own view class that inherits from EntityView2<T>. We could possibly dig into each Entity in RelatedCollection and wire into this error state event, then call base.OnListChanged. I assume that will work but it seems rather brute force and fragile. Suggestions?

Lgen version: 2.6 final. Runtime ver: v2.0.50727

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39870
Joined: 17-Aug-2003
# Posted on: 07-Jul-2008 13:46:59   

thnk2wn wrote:

I am having a similar problem to below post, regarding ListChanged not being fired in EntityView2 when the error state changes for one of the entities it contains.

Related LGEN Thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7411&HighLight=1

We are using Infralution's VirtualTree control, and have it bound to an EntityView2<T>. The related post on their site is: http://www.infralution.com/phpBB2/viewtopic.php?t=1317&sid=59de94e9a6e31a795367f771b55eb9ec

Their control is reliant on ListChanged to get the error data to refresh. My question is, what is the best way to get ListChanged raised at the view level when the error state changes at the entity level?

Raise EntityContentsChanged on the entity. That will trigger the eventview to raise ListChanged, as the collection raises ListChanged You can do that by simply calling FlagMeAsChanged() in the entity.

Frans Bouma | Lead developer LLBLGen Pro