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
454
Add ToolBar Items at runtime
posted

I wish to add tools to a popup menu at runtime but it doesn't seem to work. I've written the code below (VB.NET), I don't receive any error but I can't see the newly added tool.

Dim tool As Infragistics.Win.UltraWinToolbars.ButtonTool = New Infragistics.Win.UltraWinToolbars.ButtonTool("Test")

tool.CustomizedCaption = "Test"

Me.UltraToolbarsManager1.Tools.Add(tool)

Me.UltraToolbarsManager1.Toolbars("UltraToolbar1").Tools.AddTool("Test")

I've placed this code in the event "AfterSelectChange" of a Ultragrid cause the content of the popup menu should be different depend of the choosen grid cell.

Does anyone know how to do this?

Parents
No Data
Reply
  • 44743
    Verified Answer
    posted

    This code will add the tool to a toolbar, not a popup menu. Instead try using this code (the key "PopupMenuTool1" will be different for you depending on which popup menu you want to add the tool to):

    Dim tool As Infragistics.Win.UltraWinToolbars.ButtonTool = New Infragistics.Win.UltraWinToolbars.ButtonTool("Test")

    tool.CustomizedCaption = "Test"

    Me.UltraToolbarsManager1.Tools.Add(tool)

    CType(Me.UltraToolbarsManager1.Tools("PopupMenuTool1"), PopupMenuTool).Tools.AddTool("Test")

Children
No Data