A gallery allows a user to choose among a large number of options visually. It is typically used for tasks such as applying formatting to a selection.
In its default collapsed view, a gallery shows a single row of choices, as well as up arrows and down arrows for scrolling to other rows of choices and a drop-down arrow for switching to an expanded view.
In its expanded view, a gallery shows all of its choices at one time, a filter selection bar at the top, and tools at the bottom.
Creating a Gallery
To create a gallery, right-click a RadRibbonbar group on a RadRibbonBar control in design view. Select Add an Item, and then RadGalleryElement.
Set the MaxColumns property of the RadGalleryElement control to the number of columns of items you would like the gallery to display.
Adding Items
To add items to the gallery, follow these steps:
- Select the RadGalleryElement control.
- Click in the Items property, and then click the ellipsis button.
- In the RadItem Collection Editor, click Add to add a new RadGalleryItem.
- Use the property sheet to set the text and image properties of the RadGalleryItem.
- Click OK when you are done adding items.
Adding Groups
Groups organize the items within a gallery into distinct sections. In the screenshot of the expanded gallery above, Plain Tables and Built-In are groups.
To create a group, follow these steps:
- Select the RadGalleryElement control.
- Click in the Groups property, and then click the ellipsis button.
- In the RadItem Collection Editor, click Add to add a new group.
- Set the Text property to the caption of the new group.
- Click in the Items property of the RadGalleryGroupItem, and then click the ellipsis button.
- Click Add to add an item to the group. Each time you click Add, one of the items that you already created will be added to the group.
- Click Remove to remove any items that you do not want in the group.
- Click OK when you are done adjusting item membership in the group.
- Click OK when you are done creating groups.
Creating Filters
Filters let you select which groups to display. For example, the All Tables filter in the screenshot above includes the Plain Tables group and the Built-In group.
To create a filter, follow these steps:
- Select the RadGalleryElement control.
- Click in the Filters property, and then click the ellipsis button.
- In the RadItem Collection Editor, click Add to add a new filter.
- Set the Text property to the caption of the new group.
- Click in the Items property of the RadGalleryGroupFilter, and then click the ellipsis button.
- Click Add to add a group to the filter. Each time you click Add, one of the groups that you already created will be added to the filter.
- Click Remove to remove any groups that you do not want in the filter.
- Click OK when you are done adjusting group membership in the filter.
- Click OK when you are done creating filters.
Creating Tools
You can add tools to be displayed beneath the gallery when it is in an expanded mode:
- Select the RadGalleryElement control.
- Click in the Tools property, and then click the ellipsis button.
- In the RadItem Collection Editor, click Add to add a new tool. You can add a RadMenuItem, RadMenuComboItem, RadMenuContentItem, or RadMenuSeparatorItem.
- Use the Properties window to set the properties of the new tool.
- Click OK when you are done creating tools.