# Ribbon Group

Telerik **RadRibbonView** provides a simple and consistent way for building interfaces similar to the ribbon control used in Microsoft Office. The **RadRibbonView** consists of various elements, one of which is the **Ribbon Group**. This topic discusses concepts fundamental to the **Ribbon Group** at first and then goes into the usage of the **RadRibbonGroup** class and its features.

> tip Before proceeding with this tutorial, it is recommended to get familiar with the [Visual Structure](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/general-information/visual-structure) of the **RadRibbonView** control.

## Ribbon Group - Fundamentals

* [Layout Resizing](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-group#layout-resizing)

The **RadRibbonView** helps end-users to quickly find the tools and options they need in order to complete a task. Tools and options are organized in **logical groups** that are collected together under specific [tabs](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-tab). Or in other words - the **Ribbon Group** lets you categorize the commands to be displayed for the end-users.

**Ribbon Groups** are defined into the [Ribbon Tab](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-tab). A single **Ribbon Tab** usually contains many **Ribbon Groups** to layout its content.
![WPF RadRibbonView Ribbon Groups](https://www.telerik.com/products/wpf/documentation/assets/dc036fc82abd3e679d6713f540f503b7/ribbonview_group_overview.png)

Each Ribbon Group may have a **Header** and a **Dialog Launcher**. The **Dialog Launcher** appears in the bottom right corner of the group.
![WPF RadRibbonView Dialog Launcher and Header](https://www.telerik.com/products/wpf/documentation/assets/f7f8762bf93fb87ede57d905ca4c13dd/ribbonview_group_parts.png)

> tip The class that represents the ribbon group is **Telerik.Windows.Controls.RadRibbonGroup**.

The **RadRibbonGroup** is a [HeaderedItemsControl](http://msdn.microsoft.com/en-us/library/system.windows.controls.headereditemscontrol.aspx) and is the main part of the layout mechanism of the **RadRibbonView**.

## Layout Resizing

One of the most important feature of the **RadRibbonGroup** is the **dynamic resizing**. It refers to the ability of the **RadRibbonView** to optimize its layout depending on how much space is available.

Each **RadRibbonGroup** in a **RadRibbonTab** may have four possible sizes (**Variants**):

* **Large** - this is the default size (**Variant**).

  ![WPF RadRibbonView Ribbon Group Variant Large](https://www.telerik.com/products/wpf/documentation/assets/ed34376c9ee321cbb1a6becea56ac6de/ribbonview_group_large.png)

  > tip The **RadRibbonGroups** assumes their **DefaultVariant** (which by default is **Large**) state whenever they can.

* **Medium**
  ![WPF RadRibbonView Ribbon Group Variant Medium](https://www.telerik.com/products/wpf/documentation/assets/3feb191329a331f8273f03d8b604409f/ribbonview_group_medium.png)

* **Small**
  ![WPF RadRibbonView Ribbon Group Variant Small](https://www.telerik.com/products/wpf/documentation/assets/6fb8eaea76032d53ef7876a0443f5cc0/ribbonview_group_small.png)

* **Collapsed**
  ![WPF RadRibbonView Ribbon Group Variant Collapsed](https://www.telerik.com/products/wpf/documentation/assets/40b7f1e671f0c1fb33eb8d7fca3f878e/ribbonview_group_collapsed.png)

For more information about the layout resizing mechanism, please refer to the [Resizing](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/resizing) topic. Check out the rest of the topic which is entirely dedicated to the **RadRibbonGroup**.

## Adding Ribbon Groups to a RadRibbonView Control

As it is described in the fundamentals section, various user commands are organized in logical groups that are collected together under specific **RadRibbonTabs**. So the first step before declaring the **RadRibbonGroups** is to add **RadRibbonTabs** to your ribbon control. For more information about how to add ribbon tabs, take a look at the [Ribbon Tab](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-tab) topic.

Adding **RadRibbonGroups** is done through the **RadRibbonTab**'s **Items** property. The next example shows how to add several **RadRibbonGroups** and how to set their **Header** property.

```XAML
<telerik:RadRibbonView>
    <telerik:RadRibbonTab Header="Home">
        <telerik:RadRibbonGroup Header="Clipboard">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Font">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Paragraph">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Styles">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Editing">
        </telerik:RadRibbonGroup>
    </telerik:RadRibbonTab>
</telerik:RadRibbonView>
```

![WPF RadRibbonView Empty Ribbon Groups](https://www.telerik.com/products/wpf/documentation/assets/bce3a01e20598c1deb390c357cbdaee7/ribbonview_group_empty.png)

## Enabling the Dialog Launcher

Any group can have a dialog launcher button which appears in the bottom right corner of the group. By default the dialog launcher is not visible. In order to enable it you should set the **RadRibbonGroup**'s **DialogLauncherVisibility** property to **Visibility.Visible**.

```XAML
<telerik:RadRibbonView>
    <telerik:RadRibbonTab Header="Home">
        <telerik:RadRibbonGroup Header="Clipboard" DialogLauncherVisibility="Visible">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Font" DialogLauncherVisibility="Visible">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Paragraph" DialogLauncherVisibility="Visible">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Styles" DialogLauncherVisibility="Visible">
        </telerik:RadRibbonGroup>
        <telerik:RadRibbonGroup Header="Editing" DialogLauncherVisibility="Visible">
        </telerik:RadRibbonGroup>
    </telerik:RadRibbonTab>
</telerik:RadRibbonView>
```

![WPF RadRibbonView Dialog Launchers](https://www.telerik.com/products/wpf/documentation/assets/85aa5c3223af200cdac28b1f9f5344dc/ribbonview_group_dialoglauncher.png)

> tip The default value of the **RadRibbonGroup**'s **DialogLauncherVisibility** property is **Visibility.Collapsed.**

## Adding Content to the Ribbon Groups

The **RadRibbonGroup** is a [HeaderedItemsControl](http://msdn.microsoft.com/en-us/library/system.windows.controls.headereditemscontrol.aspx). Which means that the **RadRibbonGroup** contains a heading (or title) and multiple items. You already learned how to [set](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-group#adding-ribbon-groups-to-a-radribbonview-control) the **Header** property. Now it's time to add some content to the **RadRibbonGroup**. You should do this using the **RadRibbonGroup**'s **Items** property. The next example shows you how to build the "Clipboard" **RadRibbonGroup**.

```XAML
<telerik:RadRibbonView x:Name="radRibbonView">
    <telerik:RadRibbonTab Header="Home">
        <telerik:RadRibbonGroup DialogLauncherVisibility="Visible" Header="Clipboard">
            <telerik:RadRibbonSplitButton LargeImage="Images/IconMSOffice/32/paste.png" 
	                                            Size="Large"
	                                            SmallImage="Images/IconMSOffice/16/paste.png"
	                                            telerik:ScreenTip.Description="Paste the contents of the Clipboard."
	                                            telerik:ScreenTip.Title="Paste"
	                                            Text="Paste">
                <telerik:RadRibbonSplitButton.DropDownContent>
                    <telerik:RadContextMenu BorderThickness="0">
                        <telerik:RadMenuItem Header="Paste">
                            <telerik:RadMenuItem.Icon>
                                <Image Source="Images/IconMSOffice/16/paste.png" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Header="Paste Special...">
                            <telerik:RadMenuItem.Icon>
                                <Image Source="Images/IconMSOffice/16/pastespecial.png" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Header="Paste as Hyperlink" IsEnabled="False">
                            <telerik:RadMenuItem.Icon>
                                <Image Source="Images/IconMSOffice/16/pastehyperlink.png" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                    </telerik:RadContextMenu>
                </telerik:RadRibbonSplitButton.DropDownContent>
            </telerik:RadRibbonSplitButton>
            <StackPanel>
                <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" 
	                                            SmallImage="Images/IconMSOffice/16/cut.png"
	                                            telerik:ScreenTip.Description="Cut the selection from the document and put it on the Clipboard."
	                                            telerik:ScreenTip.Title="Cut"
	                                            Text="Cut" />
                <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" 
	                                            SmallImage="Images/IconMSOffice/16/copy.png"
	                                            telerik:ScreenTip.Description="Copy the selection and put it on the Clipboard."
	                                            telerik:ScreenTip.Title="Copy"
	                                            Text="Copy" />
                <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" 
	                                            SmallImage="Images/IconMSOffice/16/formatpainter.png"
	                                            telerik:ScreenTip.Description="Copy formatting from one place and apply it to another.Double-click this button to apply the same formatting to multiple places in the document."
	                                            telerik:ScreenTip.Title="Format Painter"
	                                            Text="Format Painter" />
            </StackPanel>
        </telerik:RadRibbonGroup>
    </telerik:RadRibbonTab>
</telerik:RadRibbonView>
```

![WPF RadRibbonView Sample Ribbon Group](https://www.telerik.com/products/wpf/documentation/assets/d7b161e47a981e5541a7dc5500b63e9a/ribbonview_group_sample.png)

## Setting Screen Tip

The Telerik **RadRibbonView**'s API allows you to associate screen tips with each one of the **RibbonGroup**. For more information, take a look at the [Screen Tips](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/screentips) topic.

## Specifying Group Variants

Each **RadRibbonGroup** in a **RadRibbonTab** may have four possible sizes (**Variants**): **Large**, **Medium**, **Small** and **Collapsed**. **Collapsed** groups always look the same - only the **Header** and an **image** are shown.
![WPF RadRibbonView Collapsed Ribbon Groups](https://www.telerik.com/products/wpf/documentation/assets/33d3d7dfc3b8c137de9507814c970d89/ribbonview_group_collapsedgroups.png)

The resizing of the elements is defined per **RadRibbonTab**. The resizing behavior of the tab is defined by setting the **Variant** collection to each of its **RadRibbonGroups** and is based on **priorities**. By default, if no **priorities** are set to the **Variants** of the **RibbonGroups,** they will be resized from **right to left**. In order to customize the order by which the groups will be resized, the developer needs to specify a **Priority** for each of the **RibbonGroup** **Variants**.

For more information and explanations about the **Variants** and **Priorities**, take a look at the [Resizing](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/resizing) topic.

## Setting Collapsed Icon

When a **RibbonGroup** is in **Collapsed** state only **Header** and **Icon** (image) are shown. To set the image source for the collapsed icon you need to set the **RadRibbonGroup**'s **Icon** property.

The collapsed state icon is displayed inside an **Image** element with Width/Height set to **16** and **Stretch** set to **None**. If your image is not displayed as intended, resize it to 16x16 or edit the ControlTemplate of the RadRibbonDropDownButton inside the RadRibbonGroup, which hosts the Image. The recommended DPI for the image files is 96dpi.

## Events

Any group can have a dialog launcher button. When you want to handle the click over this button you should attach to the **RadRibbonGroup**'s **LaunchDialog** event.

```XAML
<telerik:RadRibbonGroup DialogLauncherVisibility="Visible" Header="Clipboard" LaunchDialog="RadRibbonGroup_LaunchDialog">

</telerik:RadRibbonGroup>
```

The **LaunchDialog** event handler receives two arguments:

* The sender argument contains the **RadRibbonGroup**. This argument is of type **object**, but can be cast to the **RadRibbonGroup** type.

* The second argument is a **RadRoutedEventArgs** object.

For a full list of the exposed by the **RadRibbonView** events, take a look at the [Events - Overview](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/events/overview) topic.

The **RadRibbonView** is a complex control and the **ribbon groups** are only a small part of it. The **RadRibbonView** consists of various elements such as:

* [Application Menu](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/applicationmenu)
* [Backstage Menu](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-backstage)
* [Quick Access ToolBar](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/qat)
* [Ribbon Tab](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-tab)
* [Ribbon Gallery](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-gallery)
* [RibbonButtons Overview](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-buttons/buttons-overview)
* [Ribbon ComboBox](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/ribbon-combobox)
* [Screen Tips](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/ribbon-controls/screentips)

Additional features that you may find interesting are:

* [Selection](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/selection)
* [Resizing](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/resizing)
* [Minimization](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/features/minimization)
* [Localization](https://www.telerik.com/products/wpf/documentation/controls/radribbonview/localization)

## See Also

* [Editing Control Templates](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-editing-control-templates)
