Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > MultiColumn ComboBox > How to add Tab key as select value

Answered How to add Tab key as select value

Feed from this thread
  • Bang avatar

    Posted on Jun 27, 2011 (permalink)

    When I type something such as "abb",   the "ABB Allentown" value is selected.
    After that, the user press Enter key that value chosen.
    I want to the TAB key work the same way.
    Pls provide the alternative solution to achieve this functionality.
    Attached files

    Reply

  • Answer Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jun 30, 2011 (permalink)

    Hello Bang,

    Actually, after some time spent on trying to find solution about your question, I have managed to discover one. You can create a custom MultiColumnComboBox control, which overrides ProcessCmdKey. In this event, if a tab press was detected - use ClosePopup method to close the drop down. Please consider the following code as example:
    public class CustomMultiColumnComboBox : RadMultiColumnComboBox
    {
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Tab:
                    this.MultiColumnComboBoxElement.ClosePopup();
                    break;
            }
             
            return base.ProcessCmdKey(ref msg, keyData);
        }
    }

    I hope this helps. Let me know if you have any additional questions. 

    All the best,
    Martin Vasilev
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > MultiColumn ComboBox > How to add Tab key as select value
Related resources for "How to add Tab key as select value"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]