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

Problem with inheriting a ribbon with buttons

7 Answers 179 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Celeste Zietsman
Top achievements
Rank 2
Celeste Zietsman asked on 16 Mar 2011, 10:52 AM
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

7 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 16 Mar 2011, 12:05 PM
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

0
Celeste Zietsman
Top achievements
Rank 2
answered on 16 Mar 2011, 12:22 PM
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
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 16 Mar 2011, 12:32 PM
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
0
Celeste Zietsman
Top achievements
Rank 2
answered on 16 Mar 2011, 01:58 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 16 Mar 2011, 03:37 PM
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
0
Ezequiel
Top achievements
Rank 2
answered on 28 Nov 2012, 11:32 AM
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
0
Peter
Telerik team
answered on 30 Nov 2012, 03:02 PM
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!
Tags
RibbonBar
Asked by
Celeste Zietsman
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Celeste Zietsman
Top achievements
Rank 2
Ezequiel
Top achievements
Rank 2
Peter
Telerik team
Share this question
or