RadCombobox KeyBoard

Thread is closed for posting
2 posts, 0 answers
  1. Alexandre
    Alexandre avatar
    26 posts
    Member since:
    Feb 2008

    Posted 05 May 2008 Link to this post

    Hi everyone, I'm curently writing a 100% keyboard application (of course you can use the mouse too but it's faster when you use the keyoard only) . My prolem is when I have more than 1 result to a query I need too show the result and let the user choice which one he want to use... But I use the SelectedItemChange Event to set something else. So when the user use the keyDown to move in the combobox that call the SelectedItemChange Event but I don't want this. With the VS Combobox I setted a boolean to true when the user pressed the keydown , but in the RadCombobox the keydown event comes before the SelectedItemChange Event so my way is impossible. If you can just show me an other way I would be happy.

    Thanks and sorry for all english mistakes
  2. Georgi
    Georgi avatar
    212 posts

    Posted 07 May 2008 Link to this post

    Hello Alexandre,

    As far as I understand your scenario, you are actually using the SelectedIndexChanged event for a specific purpose and you would not like to execute the code in the event handler when the user changes the items using the Up/Down keys.

    Indeed, unlike the standard MS combobox, the RadComboBox fires the SelectedIndexChanged before the KeyDown event. So, in your case, as a workaround I would suggest using the RadTextBoxItem.PreviewKeyDown event instead of setting the boolean flag. This event can be accessed as shown below:

    this.radComboBox1.ComboBoxElement.TextBoxElement.TextBoxItem.PreviewKeyDown += new PreviewKeyDownEventHandler(TextBoxItem_PreviewKeyDown);

    I hope this helps. If you have any additional questions, please don't hesitate to write us again.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top