Help with adding items to ribbon bar

3 posts, 0 answers
  1. DConroy
    DConroy avatar
    7 posts
    Member since:
    Apr 2007

    Posted 02 May 2007 Link to this post

    I need to be able to programmatically add tabs and chunks to the ribbon bar.

    Can someone give me an example of how to recreate the steps of the quickstart in the documentation, or the simple notepad in the examples app.

    I know how to do it in the designer, but I need to do it in code.
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 03 May 2007 Link to this post

    Hello David,

    You can add a command tab to a ribbon bar using code like:
    RadRibbonBarCommandTab commandTab = new RadRibbonBarCommandTab();  
    commandTab.Tab = new TabItem("Tab");  
    this.radRibbonBar1.CommandTabs.Add(commandTab); 
    You should note that a TabItem is assigned to the command tab.

    Then you can add a chunk to the newly created tab :
    RadRibbonBarChunk chunk = new RadRibbonBarChunk();  
    chunk.Text = "Chunk";  
    commandTab.Items.Add(chunk); 

    Finally you can add a ButtonElement to the new chunk:
    chunk.Items.Add(new RadButtonElement("Button")); 


    Sincerely yours,
    Jordan
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. DConroy
    DConroy avatar
    7 posts
    Member since:
    Apr 2007

    Posted 03 May 2007 Link to this post

    Thanks.  I should have looked harder.  The documentation section for the rad ribbon bar had a detailed set of examples.

    Thanx, and great product.
Back to Top