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

Selecting a particular Chunk

2 Answers 65 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Clatonh
Top achievements
Rank 1
Clatonh asked on 24 Jul 2007, 10:10 PM
Hello all,

I need to programmatically select a particular chunk and add buttons on it. The Chunks are already created(Options, Colors) but I am not able to find a way how to select a particular chunk for eg I want to select "Colors" chunk first and add diff buttons on it and select the "Options" chunk and add buttons on it..
Can some one give me a hint/code.
Thanks in Advance.

Regards,
Claton 

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Jul 2007, 04:05 PM
Hi Clatonh,

Thank you for the question.

Each Chunk in the RAD Ribbon UI is declared as separated variable. You can access each Chunk using radRibbonBarChunk1, radRibbonBarChunk2 and etc. Here is a code snippet that adds and removes a button in existing Rad Chunk:

RadButtonElement radButtonElement1 = new RadButtonElement();//create new button element 
 
this.radButtonElement1.Text = "radButtonElement2";//set button text 
 
this.radButtonElement1.Click+=new System.EventHandler(this.radButtonElement1_Click );//you have declare button click function 
 
 
//here is the code that add radButton element from chunk 
if(! this.radRibbonBarChunk1.Items.Contains( this.radButtonElement1 )) 
         //Add radButton element 
        this.radRibbonBarChunk1.Items.Add( this.radButtonElement1 ); 
 .............................. 
//here is the code that remove radButton element from chunk 
if(! this.radRibbonBarChunk1.Items.Contains( this.radButtonElement1 )) 
         //Remove radButton element 
         this.radRibbonBarChunk1.Items.Remove( this.radButtonElement1 ); 
 


If you have any further questions feel free to ask.

 
Sincerely yours,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Clatonh
Top achievements
Rank 1
answered on 25 Jul 2007, 11:14 PM
Hi Peter,

Thanks a lot for the hint, I want to thank you and the whole of Telerik team for not only building this amazing control but also providing some amazing support..

Thanks a lot guys and keep the good work on ...

Regards
Claton
Tags
RibbonBar
Asked by
Clatonh
Top achievements
Rank 1
Answers by
Peter
Telerik team
Clatonh
Top achievements
Rank 1
Share this question
or