Problem with inheriting a ribbon with buttons

8 posts, 1 answers
  1. Celeste Zietsman
    Celeste Zietsman avatar
    17 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2011 Link to this post

    Hi

    I have created a form which I am using as a standard form with a ribbon and standard buttons. I tried to inherit this form then added another button to the ribbon and put it in a certain position but when I run the program the position is not what it suppose to be. where am I going wrong? I have added 3 attachments to demostrate this.

    Thanks
    Celeste
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Mar 2011 Link to this post

    Hello,

    This will depend on how you are adding your new items to your robbon bar. I have tried this and followed these steps
    • Created a base RadRibbonForm with a tab, a couple of groups and some buttons in each group
    • Added a second form, and inherited from the base form
    • In the load event of the second form, added in a new group, inserting it into the correct position.

    In this case all shows correctly at runtime.

    Please could you post a sample of how you are doing this using the format code block and I will do my best to help
    thanks
    Richard

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Celeste Zietsman
    Celeste Zietsman avatar
    17 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2011 Link to this post

    Hi

    My base form is in one project and the other form that i'm inheriting is in another project.

    Once I have inherited from the base form all the standard buttons are there.Then I click on add new button group and add a new button. I then move the new button in between some of the standard buttons. On the Load event the new button shows up right on the end which it is not suppose to. How can I make it show up between those standard buttons?

    Thanks
    Celeste
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Mar 2011 Link to this post

    Hello,

    I am unsure how you are managing to do this from the designer. An inherited form with a complex type such as the RadRibbonBar does not allow you to use the smart tags or designer. Adding new items to the RadRibbonBar that is on your inherited form must be done programatically. E.g.

    Dim RadRibbonBarGroup_Form1 = New RadRibbonBarGroup()
    Dim button As New RadButtonElement()
    button.Name = "Form1Button"
    button.Text = "Form 1 Button"
    RadRibbonBarGroup_Form1.Items.AddRange(New Telerik.WinControls.RadItem() {button})
    RadRibbonBarGroup_Form1.Name = "RadRibbonBarGroup_Form1"
    RadRibbonBarGroup_Form1.Text = "Form 1 Group 1"
    Me.RibbonTab1.Items.Insert(1, RadRibbonBarGroup_Form1)

    Please can you post a sample project that demonstrates your issue?
    Thanks
    Richard
  6. Celeste Zietsman
    Celeste Zietsman avatar
    17 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2011 Link to this post

    Hi Richard

    I got it working thanks. The code I used:

     

    Dim RadRibbonBarGroup_FindForm = New RadRibbonBarGroup()

    Dim RadRibbonBarButtonGroup_FindForm = New RadRibbonBarButtonGroup

    RadRibbonBarGroup_FindForm.Items.AddRange(New Telerik.WinControls.RadItem({RibbonBarButtonGroup_FindForm}) 

     

     

    RadRibbonBarGroup_FindForm.Name =

     

    "RadRibbonBarGroup_FormForm"

     

     

    RadRibbonBarGroup_FindForm.Text = "Find"

     

     

    Dim btnFind As New RadButtonElement()

     

    btnFind.Name = "btnFind"

     

    btnFind.Text = "Find"

     

     

    btnFind.Class = "ButtonElement"

     

     

    btnFind.Image = Global.culminTelFormLib.My.Resources.Resources.menu__4_()

     

    btnFind.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter  

    btnFind.TextImageRelation = System.Windows.Forms.

     

    TextImageRelation.ImageAboveText 

     

     

    RadRibbonBarButtonGroup_FindForm.Items.AddRange(

     

    New Telerik.WinControls.RadItem() {btnFind})

     

    RadRibbonBarButtonGroup_FindForm.Name = 

     

    "RadRibbonBarButtonGroup_FindForm"

     

     

     

    RadRibbonBarButtonGroup_FindForm.Text = "RadRibbonBarButtonGroup_FindForm"   

    Me.tabSubForm.Items.Insert(3, RadRibbonBarGroup_FindForm)

     

     

     



    Thanks a lot
    Celeste
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Mar 2011 Link to this post

    Hello,

    Glad you have it working. If you found any of my suggestions helpful, please remember to mark as answer. If you need further assistance, just let me know
    thanks
    Richard
  8. Ezequiel
    Ezequiel avatar
    36 posts
    Member since:
    Oct 2011

    Posted 28 Nov 2012 Link to this post

    I see this is an old post but we have a similar issue and we have other question:
     - is there any way to properties of this parent RadRibbonForm to be edited and add tabs and buttons in designer editor?

    We have a "framework" solution where we have a RadRibbonForm with some details (default icon, themes, tabs are collapsed, etc, ) that would be used in almost all apps that we have (+100).

    in some apps, we need to add new tabs and it should not be collapsed. We would like to add them in the designer tool but RadRibbonBar is locked even it's not set to be locked.

    not sure if I made myself clear.

    thanks,
    Ezequiel
  9. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 30 Nov 2012 Link to this post

    Hello Ezequiel,

    Thank you for the writing.

    I was not able to reproduce the described behavior. May be I am missing something about your case. Could you please post a code sample as this will let me investigate the acse in detail and provide you with adequate support. It will be best if you open a new support ticket and send me a sample project that I can run locally. This will help me to provide you with a quicker response.

    I am looking forward to your reply.

    Best wishes,
    Peter
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
UI for WinForms is Visual Studio 2017 Ready