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

8 posts, 1 answers
  1. msulis
    msulis avatar
    17 posts
    Member since:
    Apr 2007

    Posted 31 May 2010 Link to this post

    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.
  2. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 03 Jun 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. msulis
    msulis avatar
    17 posts
    Member since:
    Apr 2007

    Posted 07 Jun 2010 Link to this post

    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.

  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 10 Jun 2010 Link to this post

    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.
  6. msulis
    msulis avatar
    17 posts
    Member since:
    Apr 2007

    Posted 27 Jun 2010 Link to this post

    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?


  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 01 Jul 2010 Link to this post

    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
  8. Gabriel
    Gabriel avatar
    4 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2010 Link to this post

    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?
  9. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 25 Aug 2010 Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready