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

RadRibbonView - Variant priorities are in reverse order from RadRibbonBar?

1 Answer 113 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 04 Oct 2012, 03:46 PM
Hello,

I'm slowly refactoring my RadRibbonBar into a RadRibbonView and noticed that my variants didn't seem to be working...  All my groups were showing up in the collapsed state.  Eventually I discovered that by reversing the priorities, things started to work...

I had several RadRibbonGroups with priorities like this - in this scenario, as the screen width was decreased, GroupB would collapse first, and then GroupA.
<telerik:RadRibbonGroup Header="GroupA">
   <telerik:RadRibbonGroup.Variants>
      <telerik:GroupVariant Variant="Large" Priority="1" />
      <telerik:GroupVariant Variant="Collapsed" Priority="11" />
   </telerik:RadRibbonGroup.Variants>
   ...
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="GroupB">
   <telerik:RadRibbonGroup.Variants>
      <telerik:GroupVariant Variant="Large" Priority="2" />
      <telerik:GroupVariant Variant="Collapsed" Priority="12" />
   </telerik:RadRibbonGroup.Variants>
   ...
</telerik:RadRibbonGroup>


To replicate this behavior with the RadRibbonView, I need priorities like this:
<telerik:RadRibbonGroup Header="GroupA">
   <telerik:RadRibbonGroup.Variants>
      <telerik:GroupVariant Variant="Large" Priority="11" />
      <telerik:GroupVariant Variant="Collapsed" Priority="1" />
   </telerik:RadRibbonGroup.Variants>
   ...
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="GroupB">
   <telerik:RadRibbonGroup.Variants>
      <telerik:GroupVariant Variant="Large" Priority="12" />
      <telerik:GroupVariant Variant="Collapsed" Priority="2" />
   </telerik:RadRibbonGroup.Variants>
   ...
</telerik:RadRibbonGroup>

Am I crazy here or has this actually changed?

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 09 Oct 2012, 03:51 PM
Hi Rob,

We've recently improved the RadRibbonView resizing logic as we received multiple reports indicating the logic worked incorrectly. This is why it's best to test your solution with the latest internal build and the RadRibbonView control or wait for the upcoming Q3 release to test it.

In the meantime, let me try to elaborate on the resizing logic a bit more and describe how we've designed it to work:

When you define the RibbonGroup Variants inside a single tab, you need to keep in mind that all groups should take their Large state whenever possible. This means that even if you don't set a priority to the Large state, the group will try to display its content in a Large state as soon as it gets enough space. Then, in order to prioritize the other states, you have to understand that the highest number means the highest priority. This is why a Variant with Priority of 2 will be applied before applying a Variant with Priority of 1.

Also, in order to take full advantage of the resizing logic, you need to wrap the RadRibbonGroups content in our layout controls:

This being said, with the latest internal build you should use the following setup to implement your requirements:

<telerik:RadRibbonGroup DialogLauncherVisibility="Visible"
                        Header="Group A"
                        telerik:KeyTipService.AccessText="B"
                        telerik:KeyTipService.AltAccessText="BA">
    <telerik:RadRibbonGroup.Variants>
        <telerik:GroupVariant Priority="1" Variant="Collapsed" />
    </telerik:RadRibbonGroup.Variants>
    <telerik:RadCollapsiblePanel>
       ...
    </telerik:RadCollapsiblePanel>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup DialogLauncherVisibility="Visible"
                        Header="Group B"
                        telerik:KeyTipService.AccessText="M"
                        telerik:KeyTipService.AltAccessText="MA">
    <telerik:RadRibbonGroup.Variants>
        <telerik:GroupVariant Priority="2" Variant="Collapsed" />
    </telerik:RadRibbonGroup.Variants>
    <telerik:RadCollapsiblePanel>
        <telerik:RadCollapsiblePanel>
         ...
        </telerik:RadCollapsiblePanel>
       ...
    </telerik:RadCollapsiblePanel>
</telerik:RadRibbonGroup>

I attached a sample solution demonstrating this approach. Please give it a try and let me know if it helps. All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RibbonView and RibbonWindow
Asked by
Rob
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or