How to restrict user from entering text which is not in a display member of combobox items (2)

4 posts, 0 answers
  1. Juan Pablo
    Juan Pablo avatar
    19 posts
    Member since:
    Oct 2008

    Posted 12 Jan 2009 Link to this post

    Hello, I'm using the first solution you propose on http://www.telerik.com/community/forums/winforms/combobox/how-to-restrict-user-from-entering-text-which-is-not-in-a-display-member-of-combobox-items.aspx and works fine.
    I did a little change and the event handler looks like this:

            void cbNameElement_TextChanging(object sender, Telerik.WinControls.TextChangingEventArgs e)
            {
                if (!e.NewValue.Equals(string.Empty))
                {
                    if (cbName.FindItem(e.NewValue) == null)
                    {
                        this.cbName.Text = string.Empty;
                    }
                }
            }

    What I accomplished with this is that if the user writes something that is not in the list the text of the combobox is cleared.

    Now I have a problem. You clear the text, then you hit ENTER, and you write something that is not on the list, that text isn't cleared.

    Please help me with this.

    Thanks in advance.
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 13 Jan 2009 Link to this post

    Hello Juan Pablo,

    Thank you for the question.

    Please find the answer to your question in the regarded forum thread: http://www.telerik.com/community/forums/winforms/combobox/how-to-restrict-user-from-entering-text-which-is-not-in-a-display-member-of-combobox-items.aspx

    If you have additional questions, feel free to contact me.

    Sincerely yours,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. FIJO FRANCIS T
    FIJO FRANCIS T avatar
    1 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2011 Link to this post

    Hi ,
    Note :-Urgent client issue , please reply fast.

    I do have simlar issue ,  i have autocomplete event in a text box , while i type it retuns multiple columns according to items avillable but if the item is not present i have to restrict the user to type , that means  if the item is not present in collection text box should be keep cleared .
    With Thanks,
    Fijo Francis T.
    9986573129
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 15 Jun 2011 Link to this post

    Hello FIJO FRANCIS T,

    I am not sure if your question is directly related to RadControls for WinForms. Could you please share which is the RadControl you are using?

    The provided link in this thread should actually point to:
    http://www.telerik.com/community/forums/winforms/combobox-and-listbox/how-to-restrict-user-from-entering-text-which-is-not-in-a-display-member-of-combobox-items.aspx

    A bit off topic, please note that if you have urgent issues that require quick responses from us, you have to submit a support ticket from the licensed account. This is so, because support tickets are reviewed and handled according to the license that you have.

    All the best,
    Nikolay
    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.
Back to Top