Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
XamMultiColumnComboEditor - Select first filtered value on tab key down
posted

Hi, I was wondering how I would implement a XamMultiColumnComboEditor so that it would select the first value that is in the dropdown when I click tab. I would like the tab to work similarly to the Enter key essentially.

  • 4618
    Verified Answer
    posted

    Hi doyouknowme,

    This behavior is certainly possible; you would need to handle the KeyDown event of the XamMultiColumnComboEditor instance(s) in question, while checking for the Tab key, next you would need to select the first item in the items collection via the SelectedIndex property.

    Also, assuming that you want to also override the original tab behavior and give the appearance that the drop down never opened for this process, you could also handle the keydown before its processed outside of the control’s context and ensure that its IsDropDownOpen property ensures a closed state.

    I have included the following code snippet for further context as well as the attached sample which I have constructed for this issue.

    		private void xamMultiColumnComboEditor1_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.Key == Key.Tab)
                {
                    xamMultiColumnComboEditor1.SelectedIndex = 0;
     
                    e.Handled = true;
     
                    xamMultiColumnComboEditor1.IsDropDownOpen = false;
                }
            }
    

    Sincerely,
    Chris K
    Developer Support Engineer
    Infragistics, Inc.
    www.infragistics.com/support

    XMultiColmnComboSelectFrstItem116094.zip