New to Telerik UI for ASP.NET CoreStart a free 30-day trial

ASP.NET Core TileLayout Overview

The Telerik UI TileLayout TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI TileLayout widget.

The TileLayout widget allows you to configure a two-dimensional grid-based sandbox surface to display content in tiles which can be dragged around and rearranged to create any modern page design.

The component is based on the CSS Grid (with all its features) which covers the majority of cases and uses additional JavaScript logic to provide resizing, reordering, and templates customizations.

Initializing the TileLayout

To initialize the TileLayout, specify the number of Columns() at root level and use the RowSpan() and ColSpan() of the containers to position the content in the available grid space.

The example below will render a grid with two columns which can be resized both vertically and horizontally.

Razor
    @(Html.Kendo().TileLayout()
        .Name("tilelayout")
        .Columns(2)
        .RowsHeight("285px")
        .ColumnsWidth("285px")
        .Containers(c => {
            c.Add().Header(h => h.Text("Header One")).BodyTemplate("Body Text One").ColSpan(1).RowSpan(1);
            c.Add().Header(h => h.Text("Header Two")).BodyTemplate("Body Text Two").ColSpan(1).RowSpan(1);
            c.Add().Header(h => h.Text("Header Three")).BodyTemplate("Body Text Three").ColSpan(2).RowSpan(1);
        })
        .Reorderable(true)
        .Resizable(true)
    )

Grid Layout Configuration

The Telerik UI TileLayout for ASP.NET Core available grid space is defined by using the Columns() method. The number of rows in which the tiles will be displayed will automatically adjust. The columns and rows have a default width of 1fr which can be modified by using the ColumnsWidth() and RowsHeight() methods.

The RowsHeight() and ColumnsWidth() methods parameter value sets the maximum height/width the rows or columns of the widget will stretch to. Dependent on resizing, content and user interactions with the layout, they may be less than the set value.

Tile Layout Configuration

Each tile can fit within multiple rows and columns. The space that the tile takes up is determined by its container's RowSpan() and ColSpan(). For more information about the containers and their configurable properties, see the containers article.

Gaps

The grid lines between the rows and columns can be configured by specifying the Gap.Columns for the vertical space between the tiles and the Gap.Rows for the horizontal spacing.

Razor
    .Gap(g=>g.Columns(10).Rows(10))

These properties are also known as the gutters between the rows/columns.

Functionality and Features

FeatureDescription
ReorderingYou can enable the reordering feature to drag and drop the tile containers.
ResizingThe TileLayout allows you to resize its containers.
ContainersYou can specify the appearance of the containers.
Add or Remove TilesYou can add or remove tiles dynamically.
EventsThe TileLayout allows you to handle its events and implement any custom logic.
Keyboard NavigationThe component delivers keyboard shortcuts for faster navigation.

Known Limitations

Currently, the component is not supported in Internet Explorer as the browser does not support gutters.

Next Steps

See Also