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 

last event after an edit

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



Joined: 11 Apr 2008
Posts: 67

PostPosted: Thu Apr 02, 2015 9:55 pm    Post subject: last event after an edit Reply with quote

I am using programmatic binding and a generic list of objects, and the last method that runs when a cell is edited is SetValueForCell.
If you have that return false it cancels the edit, otherwise you return:
return base.SetValueForCell(row, column, oldValue, val);

The test project we did a few weeks ago had this.
When SetValueForCell runs, it has not changed the object yet, and my goal is to serialize and save the underlying list to file after every change.

Is there a vtree event after the object has changed that I can place my SaveList call in?
Or must I use a bindinglist to watch the list for changes myself, and save then? Would I use the Infralution.common bindinglist, or system.component?
_________________
James M
Back to top
View user's profile Send private message
jmaeding



Joined: 11 Apr 2008
Posts: 67

PostPosted: Thu Apr 02, 2015 11:52 pm    Post subject: Reply with quote

it looks like one way is to use the GetCellData method.
It will run once when filling in a cell, and once also after an edit.
If I set a flag like "EditPerformed", and switch it to true in the SetValueForCell method, which runs when the editor is changing a property, I can run something after a change.

I guess the biggest thing is I do not want to have to add in inotifychanged to all my object props to make bindinglist detect changes.
I wish I could set some flag in the SetValueForCell method saying if a change was to happen, then also have an event "EditCompleted" for the vtree that I could use to save the changes.
thx
_________________
James M
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Apr 07, 2015 7:19 am    Post subject: Reply with quote

Why can't you override SetValueForCell and call the base.SetValueForCell method first (which will change the value in the datasource) and then you can serialize your list after that.
_________________
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