The effectiveness of the Ribbon is due to the ability to maintain visibility of relevant controls even when the horizontal size of the window changes. To achieve this, the UI definition allows you to control how controls in a group change size in response to changes in the size of the window. This is known as scaling.
Associate Groups and Controls to Layout templates
Each <Group> (RibbonDiffXml) element in the ribbon is associated with a <GroupTemplate> (RibbonDiffXml). The GroupTemplate specifies one or more ways the controls in the group can be presented using <Layout> (RibbonDiffXml) elements. Each Layout may contain one of two types of definition for how the controls in the group are displayed.
- An <OverflowSection> (RibbonDiffXml) allows for controls to change relative position depending on the available space.
- A <Section> (RibbonDiffXml) controls the number of rows to display and where each control is displayed.
Almost all the Layout elements used in Microsoft Dynamics CRM 2011 ribbons use OverflowSection elements.
Each <Tab> (RibbonDiffXml) element must contain one <MaxSize> (RibbonDiffXml) in the <Scaling> (RibbonDiffXml). The MaxSize element is required because it establishes the default presentation of each Group in a Tab without any scaling applied. Scaling occurs when a Tab is associated with one or more <Scale> (RibbonDiffXml). Each MaxSize and Scale element is associated via the Size attribute with one of the Layout elements in the GroupTemplate used by each Group within a Tab.
The value of the Size attribute of any MaxSize or Scale element must match the Title of the available Layout elements specified in the GroupTemplate. These values are strings and there is no validation in the XSD to help you select values that are a match. The XML is always case-sensitive.
The following diagram shows how MaxSize, Scale, Group, Layout and OverflowSection elements must reference each other to enable scaling when you are using a <OverflowSection> (RibbonDiffXml) element.
The following diagram shows how MaxSize, Scale, Group, Layout and ControlRef elements must reference each other to enable scaling when you are using a <Section> (RibbonDiffXml) element.
Use Existing Group Templates
When creating a new group, instead of defining new group templates, you can re-use existing GroupTemplate elements.
Associate your new group to that template. For each control in the group, use a TemplateAlias value from one of the <Section> (RibbonDiffXml) or <OverflowSection> (RibbonDiffXml) elements found in one of the Layout elements used by that GroupTemplate. Each <OverflowSection> (RibbonDiffXml) includes an isv TemplateAlias that is not used by Microsoft Dynamics CRM. This TemplateAlias is provided to allow ISVs to add controls to that group.
Control How Scaling is Applied
Each Scale element in the Scaling element for a particular tab represents one scale step. Each Scale is applied sequentially by the order in which the Scale element appears. When reducing the horizontal space available for the ribbon, each scale element is applied in order from top down. When increasing the horizontal space available, from the smallest space the bottom scale element is in effect. Each of the available Scale elements are applied in order from the bottom to the top until all the MaxSize elements are in effect.
The Scale element Sequence attribute values are not used to determine the order in which scaling is applied. Scaling is applied by the relative order the MaxSize and Scale elements appear in the RibbonDiffXML. The Sequence value is important for both MaxSize and Scale elements because all the MaxSize elements must be grouped together above the Scale elements. When you add new MaxSize or Scale elements, be sure that you review the Sequence default value ranges assigned to all the MaxSize elements and the Scale elements. A common error is to assign Sequence values that could cause the ranges to overlap.
My above blog is based on Microsoft’s Official information.
I hope this blog about ‘Microsoft Dynamics CRM 2011 – Define Scaling for Ribbon Elements’ was informative. Please feel free to leave your comments.