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
60
Is it possible to add a custom control to a ribbon gallery?
posted

Is it possible to add custom controls to a ribbon gallery? A usability specialist has asked me to implement a ribbon gallery with the following features:

   * It contains a graphical display of data that varies over time
   * The data is laid out more like a gantt chart (with horisontal, multi-colored bars indicating time start/end)
   * The gallery content should be different in collapsed and expanded mode. (Collapsed should be rather compact, expanded should be more "verbose")

I guess the implementation of this should be based on a bar chart graphing component or something like that. The challenge is that this should appear inside a ribbon group. Does anyone out there have any idea on how this can be implemented? Is it possible to add custom components to the ribbon?

Any ideas would be welcome - to be honest I don't know where to start with this..... ;-)

Atle

 

  • 44743
    posted

    This sounds like it would be very difficult to implement with the PopupGalleryTool provided with the UltraToolbarsManager. If you only need the data displayed in the drop down and don't need anything special to display in the ribbon, I would recommend using a PopupControlContainerTool. Have a custom UserControl display the data and add an instance of it to your Form. Use that instance as the Control for the tool.

    On the other hand, if you need another graphical display of the data in the ribbon, I would also recommend createing a custom UserControl. Place a ControlContainerTool in the ribbon group and use an instance of the UserControl in the tool. The custom UserControl can have an UltraDropDownButton with the following properties set:

    • ButtonStyle = Office2007RibbonButton
    • Style = DropDownButtonOnly
    • Text = ""
    • UseOsThemes = False

    If you set these properties and give this button a small enough width, it will look like the gallery preview drop down button when it is placed in a ribbon group. Then you can select your own drop down by choosing a PopupMenuTool or PopupGalleryTool from an UltraToolbarsManager on the UserControl or by adding an UltraPopupControlContainer to you Form and pointing it to another control to be dropped down from the UserControl. Whichever option you choose, this would have to be set as the PopupItem on the UltraDropDownButton.