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 

Problems with edit mode

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



Joined: 11 May 2011
Posts: 7

PostPosted: Tue Oct 02, 2012 12:30 pm    Post subject: Problems with edit mode Reply with quote

Hello!

We have two problems using VirtualGrid (v. 4.3)

1. Escape key handling in edit mode. We use controls with some validation logic in behind (implementing Validating and Validated events). The problem is, when the Esc key is pressed, and control validation fails (Validating event CancelEventArgs.Cancel = true) editing control is hidden, but the focus stays in it, this cause our application to "hang", because there is no avail to move focus anywhere. How should we implement validation, or override Esc key handling to get the appropriate behavoiur (Esc key pressed, and even the value in the editor failed the validation, editor is closed, and focus is returned to the grid)?

2. How could we determine whether the control in edit mode or not? Our grid uses the "Del" key for deletion of rows. But it receives this event even in edit mode, when the "Del" key is supposed to delete the symbol in the editor. Is there any way to find out the mode of the grid, or to block this event propagation for the given key?
Back to top
View user's profile Send private message AIM Address
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Oct 03, 2012 5:04 am    Post subject: Reply with quote

If you could you put together a small project (or modify one of the Virtual Tree sample projects) that demonstrates the issue(s) you are having, that would help us greatly find a solution for you. You can email a zipped copy of the project to support@infralution.com.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Oct 08, 2012 12:02 am    Post subject: Reply with quote

Thanks for the sample project. From your email you have fixed the first issue so only the second issue remains. This is actually normal (although annoying) behaviour for .NET forms. See this thread on stackoverflow:

To fix the issue override the ProcessCmdKey on the form containing Virtual Tree like this:

Code:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
    if (keyData == Keys.Delete)
    {
        if (virtualTree1.EditRow != null)
            return false;
    }
    return base.ProcessCmdKey(ref msg, keyData);
}


This checks if Virtual Tree is editing and if so disables the normal key handling that would be done for the context menu.
_________________
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