RibbonBar Items?

2 posts, 0 answers
  1. anthony
    anthony avatar
    2 posts
    Member since:
    Oct 2006

    Posted 20 Oct 2006 Link to this post

    Hi there,
    Maybe I'm missing something but I couldn't find a way to add some custom items in a ribbonbar chunk except the items which are available in the context menu in design mode? There're only several buttons, dropdowns and combobox available.
    I want to create a gallery-like control using your scroll panel and buttons placed inside.
    Am I doing something wrong?
  2. Chris
    Admin
    Chris avatar
    221 posts

    Posted 20 Oct 2006 Link to this post

    Hi Anthony,
    First, thank you for evaluating r.a.d.controls for WinForms. You're right, in design-mode you're provided with only several items which you can insert in a given RibbonBar chunk or button group. We've tried to keep the design mode experience simple and easy to use.
    Anyway what you're trying to achieve is possible and you can use the following code:

       RadCanvasViewport viewport = new RadCanvasViewport();
       RadScrollViewer scrollViewer = new RadScrollViewer(viewport);
       scrollViewer.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
       scrollViewer.MinSize = new Size(70, 60);
       RadButtonElement testButton = new RadButtonElement("Button");
       scrollViewer.Viewport.Children.Add(testButton);

       this.myRibbonBarButtonGroup.Children.Add(scrollViewer);

    In the sample code above we've added only one button in the scroll viewer but you can add more buttons in a StripLayoutPanel for example and put it inside the Viewport.
    I hope this information helps.

    Best wishes,

    Chris
    the telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top