View previous topic :: View next topic |
Author |
Message |
GreyCloud
Joined: 13 Nov 2008 Posts: 19
|
Posted: Sun Jul 18, 2010 8:13 pm Post subject: EditOnKeyPress & OnKeyUp |
|
|
Hi,
when i have EditOnKeyPress true and also handle the OnKeyUp method i find the onKeyUp gets called twice - is this correct behaviour?
David |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jul 19, 2010 12:56 am Post subject: |
|
|
I wasn't able to replicate this behaviour using the DataSet Browser sample project. If you can replicate this behaviour in a small sample project and send us zipped copy to support@infralution.com (with step by step description of what you are doing) then we will take a closer look at the issue. _________________ Infralution Support |
|
Back to top |
|
|
GreyCloud
Joined: 13 Nov 2008 Posts: 19
|
Posted: Mon Jul 19, 2010 4:36 pm Post subject: |
|
|
meh, coding late at night is unhealthy, i should have mentioned the "key" issue being the key combination - Shift+Enter sorry!
I have mailed through an example with steps to reproduce
David |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Jul 20, 2010 12:36 am Post subject: |
|
|
Thanks for the sample. There is a minor issue in the way Virtual Tree is handling "Enter" key presses when EditOnKeyPress is set to true. In this case Virtual Tree is sending opening the first editor and then sending it the "Enter" key press - which in turn causes the editor to close.
The workaround is to handle the KeyPress event and if the character is an enter mark the event as handled - this will prevent VirtualTree from further handling the event and prevent the behaviour. eg
Code: | private void _virtualTree_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
e.Handled = true;
}
} |
We will fix this in the next release.
Quote: | Out of interest is there any way to disable the default key commands (enter to edit, arrow keys and tab to navigate when the modifier keys are down? – for example I wanted to use ctrl-up/down to move siblings up and down and also shift and ctrl enter to do add child / sibling) |
To handle the enter, escape and arrow keys you need to override the ProcessCmdKey method or the sub-methods that it calls
Code: | ProcessNormalCmdKeys // called when there is no active editor
ProcessEscapeCmdKey
ProcessEnterCmdKey
ProcessRightCmdKey etc
ProcessEditCmdKeys // called when there is an active editor
ProcessEditEscapeCmdKey
ProcessEditEnterCmdKey
ProcessEditRightCmdKey etc |
_________________ Infralution Support |
|
Back to top |
|
|
GreyCloud
Joined: 13 Nov 2008 Posts: 19
|
Posted: Tue Jul 20, 2010 9:13 am Post subject: |
|
|
As ever, excellent support
Thanks
David |
|
Back to top |
|
|
|