Dynamic menu text

2 posts, 1 answers
  1. David A.
    David A. avatar
    126 posts
    Member since:
    Aug 2008

    Posted 09 Jun 2011 Link to this post


    I have a CommandBarDropDownButton with several menuitems, several of which I am dynamically changing the text the the CBDropDownButton is clicked.  Several of our users are telling us that the text does not change until the second time they click on the CBDropDownButton.  I cannot duplicate this on my machine but I have seen it on others.  I am handling the click event of the CBDropDownButton and setting the menuitem text there. 

    is there a better way to do this to ensure the user will see the dynamic menu item text immediately?
  2. Answer
    Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 15 Jun 2011 Link to this post

    Hello David A.,

    Thank you for your question.

    It is better to change the text of the items on the PopupOpening event to ensure that the text will be changed before the popup is shown. Here is a code sample that demonstrates this:
    public Form1()
        this.commandBarDropDownButton1.DropDownMenu.DropDownOpening += new CancelEventHandler(DropDownMenu_DropDownOpening);
    void DropDownMenu_DropDownOpening(object sender, CancelEventArgs e)

    I hope this helps. Feel free to ask if you have any additional questions.

    Ivan Todorov
    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