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 

tab key focus behavior in tree's columnn with editor set

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



Joined: 20 Oct 2010
Posts: 1

PostPosted: Wed Oct 20, 2010 7:09 am    Post subject: tab key focus behavior in tree's columnn with editor set Reply with quote

there are two columns in virtual tree.I set column A's editor to custom control. This custom control consist of one textbox and one button. The hehavior of custom control in form is press tab key , the textbox get input focus,press tab key again, the button gets input focus,then press enter ,a dialog popup.


The requirement is when set cell's editor in virtual tree to this custom control.the behavior needs the same as in form while press tab key . Not currently column B get focus when I press tab key again.

How do I implement it? whether there is a property in virtual tree or cell can affect tab focus or needs write some code?

Thanks in advance


aderson
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Oct 21, 2010 1:02 am    Post subject: Reply with quote

To enable tabbing within the editor control you would need to derive a new VirtualTree control and override the ProcessEditTabCmdKey as shown below.

Code:
public class MyTree : VirtualTree
{
    protected override bool ProcessEditTabCmdKey(Keys modifiers)
    {
        if (EditWidget != null)
        {
            ContainerControl control = EditWidget.EditorControl as ContainerControl;
            if (control != null)
            {
                bool forward = (modifiers != Keys.Shift);
                if (control.SelectNextControl(control.ActiveControl, forward, true, true, false))
                    return true;
            }
        }
        return base.ProcessEditTabCmdKey(modifiers);
    }
}

_________________
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