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 

In place virtual tree editing

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



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Fri May 02, 2014 5:27 am    Post subject: In place virtual tree editing Reply with quote

Is it possible to edit the virtual tree to support in place editing?

For example, a context menu "Rename" will allow to edit the node, similar to Windows Explorer. I also need to know which node/record edited to perform other task for that record.

Thanks in advance for any suggestions.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun May 04, 2014 11:09 pm    Post subject: Reply with quote

Yes you can add a CellEditor (in the VirtualTree designer) that uses a standard TextBox. Then set the CellEditor property for the main column.

You should also set the VirtualTree.SelectBeforeEdit property to true. This means the user has to click on the selected row again to commence editing.
If you want to prevent accidental editing then you can require a double click before editing starts by setting the VirtualTree.EditOnDoubleClick property to true.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Sun May 04, 2014 11:41 pm    Post subject: Reply with quote

Thanks for your response, will review your suggestions.
Back to top
View user's profile Send private message
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Fri May 23, 2014 7:20 am    Post subject: Reply with quote

Could you please suggest, what I need to do to solve following issue:

- During in place editing, when the tab key pressed currently the row updated and select the following row in edit mode. I also use CTRL+A to select all as said in this post using custom UniversalEditBox:
http://www.infralution.com/phpBB2/viewtopic.php?t=2016&highlight=celleditor+cursor+focus

I don't want to select the following row in edit mode, instead set the focus to another control.

- During in place editing CTRL+Left Arrow or CTRL+Right arrow don't select the previous or next word in edit box.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun May 25, 2014 11:27 pm    Post subject: Reply with quote

To prevent the tab key changing the edited cell within Virtual Tree you would need to derive your own control from Virtual Tree and override the ProcessEditTabCmdKey method. The base implementation calls CompleteEdit() to finish editing the current cell then calls EditNext. You would need to override this as below so it doesn't call EditNext:

Code:
protected override bool ProcessEditTabCmdKey(Keys modifiers)
{
     return !CompleteEdit();
}


Note that this behaviour would be quite non-standard and may be confusing for users.

VirtualTree uses the Control-Arrow Keys for navigation. If you want to enable their use within an editor then you would need to override the ProcessEditRightCmdKey and ProcessEditLeftCmdKey methods to return false.
_________________
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