Delete value in ComboBox

2 posts, 0 answers
  1. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 01 Sep 2010 Link to this post

    Hi

    I have set our ComboBoxes to ReadOnly as we don't want users entering foreign values. We also need the ability to clear a selected value with the Delete key. I have seen other threads on this, with the response saying to use the "Clear Selection" button.

    As our forms are mainly used by Data Entry clerks, they are keyboard driven users. What they need is to be able to tab from field to field and quickly delete existing values. This should be achieved with the Del or Backspace key. Having to switch to a mouse or arrow down to a Clear Selection button adds too many actions to what should be a simple work flow.

    Is there a possibility to attach the "Clear Selection" function to the users Del key?

    Regards
    Murray Eaton
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 02 Sep 2010 Link to this post

    Hello Murray,

    Thank you for contacting us.

    You can handle the KeyDown event of the ComboBox and clear the value if it is a Delete key, for example:

    private void radComboBox_KeyDown(object sender, KeyEventArgs e) 
           
               if(e.Key == Key.Delete) 
               
                   (sender as RadComboBox).SelectedItem = null
               
           }

    Hope this helps. If you have any other questions please let us know.

    Greetings,

    Konstantina
    the Telerik team

     

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top