Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Updating modal UITypeEditors

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
keesp
Guest





PostPosted: Thu Oct 13, 2005 3:57 pm    Post subject: Updating modal UITypeEditors Reply with quote

Hi,

In my universal edit box I use a number of UITypeEditors (through reflection) that have a modal edit style. The objects they represent are often complex, and the properties of these objects can be modified.
The problem is that the universal edit box does not consider such objects changed if the properties are modified (which is correct behaviour). How can I ensure that these changes are reflected towards the universal edit box and the cellbinding that uses the universal edit box?

Thanks

Kees
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 14, 2005 12:29 am    Post subject: Reply with quote

Your UITypeEditor should probably return a new object (unless the user cancels the action). That way the UniversalEditBox can tell something has changed. If you implement the ICloneable interface you can use this to clone the edited object upfront.

You should also override the Equals method to implement equality by value (rather than just reference equality) - as this is what UniversalEditBox uses to determine if the value has changed.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
keesp
Guest





PostPosted: Fri Oct 14, 2005 10:47 am    Post subject: continued... Reply with quote

Okay,

I understand this, but I have found another way to catch the change in UniversalEditBox. What I currently don't see is how I can pass this change to the cellbinding so that it can perform the actions necessary to effectuate the change

Regards,

Kees
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 14, 2005 10:36 pm    Post subject: Reply with quote

VirtualTree CellWidget does the same sort of checking on whether the value has changed - so you will run into the same problem there unless you actually return a different object. If your editor just changes internal properties of the original object then you will also probably break the cancel mechanism (when you hit the escape key). You really do need to create a copy of the object for this to work properly.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group