sgray128 8/21/2016 8:35:25 AM

RadTileList example code

This is a simple example of how to code the RadTileList. The code in the code behind could probably have been put in the markup... but that's the way that it evolved.


<telerik:RadTileList runat="server" ID="RadTileList1" AppendDataBoundItems="false"
        <CommonTileBinding TileType="RadImageAndTextTile" Shape="Square" DataNavigateUrlField="NavigateUrl" />
        <ImageAndTextTileBinding DataTextField="FolderDesc" DataImageUrlField="FirstImageRelative" />
            <div class="peekTemplateClass">
                <%# Eval("FolderDesc")%>

Code Behind

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Me.RadTileList1.DataSource = GetFolders().AsEnumerable.Reverse.CopyToDataTable
End Sub
Protected Sub RadTileList1_OnTileCreated(sender As Object, e As TileListEventArgs) Handles RadTileList1.TileCreated
    'work with common settings for all tiles
    e.Tile.PeekTemplateSettings.ShowInterval = 0
    e.Tile.PeekTemplateSettings.CloseDelay = 0
    e.Tile.PeekTemplateSettings.ShowPeekTemplateOnMouseOver = True
    e.Tile.PeekTemplateSettings.HidePeekTemplateOnMouseOut = True
    e.Tile.PeekTemplateSettings.AnimationDuration = 800
    'using properties specific for a given tile type - check the tile type first
    Dim tile As RadImageAndTextTile = TryCast(e.Tile, RadImageAndTextTile)
    If Not Object.Equals(tile, Nothing) Then
        tile.ImageWidth = 150
    End If
End Sub