View previous topic :: View next topic |
Author |
Message |
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Fri May 02, 2014 5:27 am Post subject: In place virtual tree editing |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun May 04, 2014 11:09 pm Post subject: |
|
|
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 |
|
|
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Sun May 04, 2014 11:41 pm Post subject: |
|
|
Thanks for your response, will review your suggestions. |
|
Back to top |
|
|
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Fri May 23, 2014 7:20 am Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun May 25, 2014 11:27 pm Post subject: |
|
|
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 |
|
|
|