Multiple Controls Side by Side Ribbon Bar Group

2 posts, 1 answers
  1. Robert
    Robert avatar
    3 posts
    Member since:
    Jan 2014

    Posted 16 Jun 2015 Link to this post


    I am new telerik components and hoping someone may be able to point me in right direction. I am attempting to add a label and datetime picker control side by side in my ribbon bar group. I have managed to get the label and datetime picker to appear on the same row (for lack of a better term) in the group, but they just overlap each other.

    I found a similar thread called "Label in Ribbon Bar", which sets positioning of the controls in a panel...then the panel is added to the group as RadHostItem. I tried the suggested code, but it doesn't appear to work, as the ribbon group ended up empty...not displaying any controls. Then I tried without the panel. The label and datetime picker reappeared, but were still overlapped.

    I have included a code snippet below. Any insight or help is appreciated.

     RadLabel label = new RadLabel();
     label.Location = new Point(5, 5);
     label.Text = "test";
     RadHostItem item1 = new RadHostItem(label); RadDateTimePicker picker = new RadDateTimePicker();
     picker.Location = new Point(32, 5);
     picker.MinimumSize = new Size(100, 0);
     RadHostItem item2 = new RadHostItem(picker);
     ribbonGroupSettings.Items.AddRange(new RadHostItem[] { item1, item2 }); ribbonGroupSettings.MinSize = new Size(ribbonGroupSettings.Size.Width + label.Width + 100 + padding, 0);  


  2. Answer
    Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 18 Jun 2015 Link to this post

    Hello Robert,

    Thank you for writing.

    Here is a sample code snippet, demonstrating how to achieve the illustrated result from the attached screenshot: 
    public Form1()
        RadRibbonBarGroup mainGroup = new RadRibbonBarGroup();
        mainGroup.Text = "MainGroup";
        RadRibbonBarButtonGroup subGroup = new RadRibbonBarButtonGroup();
        subGroup.Orientation = Orientation.Horizontal;
        RadLabelElement label = new RadLabelElement();
        label.Text = "Here is a sample text";
        RadDateTimePickerElement dtPicker = new RadDateTimePickerElement();
        dtPicker.MinSize = new System.Drawing.Size(150, 20);

    I hope this information helps. Should you have further questions, I would be glad to help.
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top