Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
465
Populating UltraDropDownButton at run time
posted

Hi,

I have an Ultratoolbarmanager on my form and an ultradropdownbutton. Ideally to have buttons in the ultradropdownbutton, i would customize the toolbarmanager and use the "Tools" and "PopupMenuToolDesigner" to add the buttons i need and update the PopUpitem in the Ultradropdownbutton control.

I need to do all this at run time. Any sample would be great.

Thanks in advance!

Renu

  • 465
    Verified Answer
    posted

    Hi,

    I believe i got it working. Attached is code:

     ButtonTool  button1 = new ButtonTool("Template1");

     

     

     

     

     

     

     

     

     

    ButtonTool button2 = new ButtonTool("Template2");

     

     

     

    ButtonTool button3 = new ButtonTool("Template1");

     

     

     

    ButtonTool button4 = new ButtonTool("Template2");

     

     

    PopupMenuTool newmenu = new PopupMenuTool("MenuTool");

    button3.SharedProps.Caption =

     

    "Template bulk 1";

    button4.SharedProps.Caption =

     

    "Template bulk 2";

     

     

     

    this.ultraToolbarsManager1.Tools.AddRange(new ToolBase [] {newmenu,button3,button4});

    newmenu.Tools.AddRange(

     

    new ToolBase[] { button1, button2 });

     

     

     ultraDropDownButton1.PopupItem = newmenu;