Suppress Combobox Drop Down when Setting the Text

2 posts, 0 answers
  1. Jeremy Murtishaw
    Jeremy Murtishaw avatar
    86 posts
    Member since:
    Apr 2009

    Posted 08 Jul 2009 Link to this post

    Hello,

    I'd like to suppress the dropdown from opening when I change the Text property of my combobox. Presently, I'm doing:

                    cboRecord.Text = psName + " [" + psID + "]";
                    cboRecord.CloseDropDown();
                    cboMasterfile.Text = Sands.GetFullMasterfile(psMasterfile);
                    cboMasterfile.CloseDropDown();

    But when this executes, you still see the dropdown open and then immediately close, which looks buggy. Is there any way to avoid having it open altogether? I've tried disabling the control before and enabling after, but that does not work.

    Thanks!
    Jeremy
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 13 Jul 2009 Link to this post

    Hello Jeremy Murtishaw,

    You can achieve this behavior by using a boolean flag. You set this flag to true while editing the text and when you are done, you set it to false. Then in the PopupOpening event you check for this flag and cancel the opening of the drop down. You can access the PopupOpening event through the ComboBoxElement property of RadComboBox.

    Best wishes,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top