Prevent search text to set value not in the combobox

6 posts, 1 answers
  1. Tony
    Tony avatar
    3 posts
    Member since:
    Feb 2012

    Posted 10 Apr 2012 Link to this post

    Hi,

    We have a combobox with search capabilities via the IsEditable property. However, we need to enforce the rule that the combobox-textbox can not contain values that are not in the combobox list of existing values. Is there an easy way to do it or do we need to add plumbing code to do so.

    TW
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 12 Apr 2012 Link to this post

    Hello,

    You could set the IsReadOnly property to True - that will disable typing and selecting items which are not in the ItemsSource of the ComboBox.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Tony
    Tony avatar
    3 posts
    Member since:
    Feb 2012

    Posted 12 Apr 2012 Link to this post

    Hi Konstantina,

    The customer doesn't want to disable typing, but they just don't want to endup with a text that is not in the combobox list of values. They also want to see the resulting text as they're typing of course. It's a very hard requirement as far as UI behavior is concern.

    TW
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 17 Apr 2012 Link to this post

    Hi Tony,

    In this case I would suggest to validate the Text of the ComboBox as demonstrated in the following example:
    http://demos.telerik.com/silverlight/#ComboBox/Validation

    Kind regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Tony
    Tony avatar
    3 posts
    Member since:
    Feb 2012

    Posted 17 Apr 2012 Link to this post

    Hi Yana,

    We're already using the validation in our controls. However, the users still wants to completely limit the resulting text to only the ones in the combobox.

    TW
  7. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Apr 2012 Link to this post

    Hello Tony,

    There is not built-in functionality in RadComboBox which you can use to achieve this requirement. However, you can try to subscribe to KeyDown event of the control and check the entered text in its handler.

    Hope this helps.

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner