This is a migrated thread and some comments may be shown as answers.

RibbonBar Items?

1 Answer 165 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
anthony
Top achievements
Rank 1
anthony asked on 20 Oct 2006, 01:58 PM
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?

1 Answer, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 20 Oct 2006, 02:51 PM

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
Tags
RibbonBar
Asked by
anthony
Top achievements
Rank 1
Answers by
Chris
Telerik team
Share this question
or