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

How do I add a custom control to a Ribbonbar chunk?

7 Answers 191 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
msulis
Top achievements
Rank 1
msulis asked on 01 Jun 2010, 01:02 AM
I think I saw an article on this somewhere, but I can't find it. I want to add a Usercontrol or even just a nonstandard Telerik control (like radDateTimePicker) to an existing RadRibbonBar.

7 Answers, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 03 Jun 2010, 04:42 PM
Hello msulis,

Thank you for writing.

You can use RadHostItem to add any descendant of the Control class in RadRibbonBar as shown in this knowledge base article. Let me know if you have any additional questions.

Kind regards,
Martin Vasilev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
msulis
Top achievements
Rank 1
answered on 07 Jun 2010, 10:47 PM
Excellent - thanks for the link. That does it.

Might I suggest you guys do a little housecleaning and add some tags and clean up your naming conventions? It's pretty sad that I spent an hour hunting for this on your site and couldn't find it. I'm sure you put a lot of work into getting your support/KB/search all working, but you could probably learn a lot by watching someone try to learn your tools - it's pretty frustrating. These controls are supposed to save me time, but honestly I'm investing WAY too much time trying to learn the specifics.

A couple specific ideas pop out in this case...

"WinForms Control" - that's not a term I understand. You might try something like "Usercontrol" or "Custom Control".

You might also name your components consistently... is it a "RadRibbonBar", a "RibbonBar", or a "Ribbon Bar"?

When I search on "add custom control to ribbonbar" or "add usercontrol to ribbonbar" I'd expect that article to come up.

Thanks for the help, and thanks for listening to me complain :)

-----edit: msulis
sorry just realized this is a public forum. feel free to read this response then remove it, as it doesn't really contribute to the thread.

0
Martin Vasilev
Telerik team
answered on 10 Jun 2010, 04:59 PM
Hello msulis,

Thank you very much for your feedback, we highly appreciate it. We will check our current tags and will add some additional if needed. Do not hesitate to contact us again if you need any additional assistance.

Best wishes,
Martin Vasilev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
msulis
Top achievements
Rank 1
answered on 28 Jun 2010, 03:07 AM
Okay wait - another complaint. What the heck is a "chunk"? I don't have any object in the hierarchy called a "chunk"?

even the page...
http://www.telerik.com/help/winforms/ribbonbarprogrammingtabsandchunks.html

mentions a chunk, then proceeds to utilize a RadRibbonBarGroup. is a RadRibbonBarGroup the same thing as a chunk? Why is this so hard to figure out? Come on guys, I'm getting my butt kicked trying to figure out your terminology, can you please make this easier somehow?


0
Martin Vasilev
Telerik team
answered on 01 Jul 2010, 11:49 AM
Hello Michael,

Thank you for getting back to us.

RibbonBar's "Chunk" and "Group" represents the same visual element. We have completely refactored the layout system of the RadRibbonBar control in Q1 2009, and we also gave the new name "Group" to this element.  However, the term "Chunk" is still used in our documentation because it describes not an actual element class, but the standard element in RibbonBar terminology.

I hope this information is useful. Do not hesitate to contact us if you have other questions.

Greetings,
Martin Vasilev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Gabriel
Top achievements
Rank 1
answered on 20 Aug 2010, 08:39 AM
I used the same code that you wrote, but it didn't work, and it doesn't show me anything.
I used this code:
DateTimePicker datePicker = new DateTimePicker();    
RadHostItem datePickerHost = new RadHostItem(datePicker);    
                  
this.RadRibbonBarChunk1.Items.Add(datePickerHost);

what's the problem?
0
Nikolay
Telerik team
answered on 25 Aug 2010, 02:15 PM
Hi Gabriel,

In our latest versions you should set the MinimumSize of the hosted control and the appropriate MinSize of the group as well:
public Form1()
{
    InitializeComponent();
  
    this.Shown += new EventHandler(Form1_Shown);
}
  
void Form1_Shown(object sender, EventArgs e)
{
    int padding = 10;
  
    DateTimePicker datePicker = new DateTimePicker();
    datePicker.MinimumSize = new Size(100, 0);
    RadHostItem datePickerHost = new RadHostItem(datePicker);
  
    this.radRibbonBarGroup1.Items.Add(datePickerHost);
    this.radRibbonBarGroup1.MinSize = new Size(this.radRibbonBarGroup1.Size.Width + 100 + padding, 0);
}

I hope this helps.

Kind regards,
Nikolay
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
RibbonBar
Asked by
msulis
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
msulis
Top achievements
Rank 1
Gabriel
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or