windowsforms-10985-controls-and-libraries-navigation-controls-tile-control-groups-and-items-tile-groups-and-items.md
This article will introduce to you tiles and tile groups - basic Tile Control elements. In this topic:
A Tile is the TileItem class object that is the Windows Modern-styled push or check button. The Tile Control supports four tile sizes, specified by the TileItem.ItemSize property.
The figure below demonstrates tiles of all supported sizes.
At design time, you can use a tile group’s smart-tag to add a tile of the desired size (see below).
Each tile can display one or many images and text blocks. Refer to the Tile Item Structure topic to learn more. You can also animate your tiles by using the Tile Frame Animation feature.
Tiles can be dragged at both design and runtime. To disable dragging tiles at runtime, set the TileControl.AllowDrag property to false. You can also set the TileControl.AllowDragTilesBetweenGroups property to false to prohibit dragging tiles to tile groups other than their current parent groups. In this case, dragging tiles within their source groups’ bounds will still be enabled.
By default, tiles act as simple push buttons - clicking a tile raises the TileItem.ItemClick event that allows you to perform required actions. However, if you set the TileControl.ItemCheckMode to a value different from None , end-users will be able to right-click a tile to check it. Checked tiles are tiles with their TileItem.Checked properties equal to true. At runtime, such tiles display a check mark at their upper right corner depending on the currently applied application skin (see the following image). Checking and unchecking tiles fires the TileItem.CheckedChanged event.
Tiles can also be selected. To enable this behavior, set the TileControl.AllowSelectedItem property to true. When enabled, this option allows you to select tiles by clicking them. Selected tiles are painted using appearance settings, stored within the Selected section of the TileControl.AppearanceItem property (see ‘Tile 2’ tile at the figure below). A selected tile is stored in the TileControl.SelectedItem property.
To change the distance between neighboring tiles, use the TileControl.IndentBetweenItems property.
Tile groups are instances of the TileGroup class that host tiles. Each Tile Control must have at least one group. If you need more tile groups, click the corresponding link within the Tile Control’s smart-tag.
In code you can access the TileControl.Groups collection and modify it as required. To organize tiles into the specific tile group, add these tiles to the group’s TileGroup.Items collection.
Tile groups can display captions, assigned to their TileGroup.Text properties (see the figure below). By default, these captions are not displayed. If you wish to show these text blocks, set the TileControl.ShowGroupText property to true or check the related check-box within the control’s smart-tag. The TileControl.AppearanceGroupText property provides access to the appearance settings, applied to tile group captions.
To change the distance between neighboring groups, use the TileControl.IndentBetweenGroups property.
Depending on the control’s TileControl.Orientation property, both groups and items within them are arranged differently.
Starting from version 16.1, the Tile Control supports Adaptive Layout Mode.
Use the Tile Control’s HorizontalContentAlignment and VerticalContentAlignment properties to align the tile groups within the Tile Control.
using DevExpress.Utils;
tileControl1.HorizontalContentAlignment = HorzAlignment.Near;
tileControl1.VerticalContentAlignment = VertAlignment.Center;
Imports DevExpress.Utils
tileControl1.HorizontalContentAlignment = HorzAlignment.Near
tileControl1.VerticalContentAlignment = VertAlignment.Center
See Also