Selecting a particular Chunk

3 posts, 0 answers
  1. Clatonh
    Clatonh avatar
    8 posts
    Member since:
    Jun 2007

    Posted 24 Jul 2007 Link to this post

    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.

  2. Peter
    Peter avatar
    1151 posts

    Posted 25 Jul 2007 Link to this post

    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,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Clatonh
    Clatonh avatar
    8 posts
    Member since:
    Jun 2007

    Posted 25 Jul 2007 Link to this post

    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 ...

Back to Top