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

Help with adding items to ribbon bar

2 Answers 107 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
DConroy
Top achievements
Rank 1
DConroy asked on 02 May 2007, 03:58 PM
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 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 03 May 2007, 06:50 AM
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
0
DConroy
Top achievements
Rank 1
answered on 03 May 2007, 11:57 AM
Thanks.  I should have looked harder.  The documentation section for the rad ribbon bar had a detailed set of examples.

Thanx, and great product.
Tags
RibbonBar
Asked by
DConroy
Top achievements
Rank 1
Answers by
Jordan
Telerik team
DConroy
Top achievements
Rank 1
Share this question
or