We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Adding RibbonTabs to Ribbon

Thread ID:

Created:

Updated:

Platform:

Replies:

80785 Apr 27,2009 10:39 AM Apr 28,2009 11:56 AM WPF 5
loading
Tags: Tools
Arjan van der Stelt
Asked On April 27, 2009 10:39 AM

Hi,

I'm trying to create a class that is derived from the RibbonTab class. Here is my code:

.XAML
x:Class="TestSyncfusion.TestTab" xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Height="300" Width="300">


.XAML.CS
public partial class TestTab : RibbonTab
{
public TestTab()
{
InitializeComponent();
}
}

Now I'm trying to add an instance of this class to my Ribbon. I'm also adding two normal RibbonTabs.

RibbonTab tab1 = new RibbonTab();
tab1.Caption = "Tab1";
this.MyRibbon.Items.Add(tab1);

TestTab tab2 = new TestTab();
tab2.Caption = "Tab2";
this.MyRibbon.Items.Add(tab2);

RibbonTab tab3 = new RibbonTab();
tab3.Caption = "Tab3";
this.MyRibbon.Items.Add(tab3);

As you can see in the image (attachment) there is a space between the first and third tab (here should be my own created tab)!!

Now my question is: Why isn't my own made tab being showed?!

Thanks,

Arjan





Tabs_9af905ff.zip

Prabhu P [Syncfusion]
Replied On April 27, 2009 03:04 PM

Hi Arjan,

Thank you for your interest in Syncfusion products.

The way which you have tried to derive a class from RibbonTab was wrong. We have tried to create a sample by using your code snippet and it’s not working. We wondering that how did you get that snapshot given in attachment. However, we have created a simple sample for demonstrating to create a custom class which is derived from RibbonTab and added the custom class’s element into the Ribbon. Please find the sample from the link given below .

http://files.syncfusion.com/support/tools.WPF/7.2.0.20/80785/main.htm

We hope this sample will fulfill your requirement. Please let me know if you have any other queries.

Thanks,
Prabu



Arjan van der Stelt
Replied On April 28, 2009 03:32 AM

Hi,

Thank you for the fast solution. The solution you gave works. However if I use that solution I have to design my custom tab programmatically. I was hoping I could do this using the designer (.XAML file)?!

In the attachment you will find the project that I made. Here you can see how I tried it.

Thanks,

Arjan



TestApplication_380d36a.zip

Michael Matela
Replied On April 28, 2009 04:03 AM

>Now I'm trying to add an instance of this class to my Ribbon. I'm also adding two normal RibbonTabs
>As you can see in the image (attachment) there is a space between the first and third tab (here should be my own created tab)!!
>Now my question is: Why isn't my own made tab being showed?!

I just did the same thing, with the same problem. Actually, your tab is shown (try adding a Keytip, then you'll be able to switch to it). The "problem" is in your code:

>lt;syncfusion:RibbonTab
x:Class="TestSyncfusion.TestTab" xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Height="300" Width="300">
<

Here you are setting the Height and Width to 300, which makes the displayed Tab that big. Into that space the actual tab is drawn at the bottom left position. Simply remove these two properties, and all is fine.

You could argue that the control should ignore the setting or better coerce it to a useful value instead.

Kind regards,
Daniel Rose
EXAPT Systemtechnik GmbH


Arjan van der Stelt
Replied On April 28, 2009 04:28 AM

Hi Daniel,

Thanks for the solution.
It workes great!!

Kind regards,

Arjan


Prabhu P [Syncfusion]
Replied On April 28, 2009 11:56 AM

Hi Arjan,

We are glad to hear that your problem has been resolved. Please let us know if you have any other queries.

Best Regards,
Prabu


>Hi Daniel,

Thanks for the solution.
It workes great!!

Kind regards,

Arjan




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;