Beispiel #1
0
    protected void RadTileList1_OnTileDataBound(object sender, TileListEventArgs e)
    {
        //test the tile type first so its specific properties can be used
        RadImageAndTextTile tile = e.Tile as RadImageAndTextTile;

        if (!object.Equals(tile, null))
        {
            //this is the path to a folder that hosts the needed images
            tile.ImageUrl = string.Format("SampleImages/Northwind/Customers/{0}.jpg", DataBinder.GetPropertyValue(e.Tile.DataItem, "CustomerID", null));
            //the URL can be generated in the SQL query itself instead of using events, of course. For example
            //('../../../Img/Northwind/Customers/' + CAST([CustomerID] as VARCHAR(5)) + '.jpg') As ImgUrl
            //and ImgUrl can be passed to the DataImageUrlField property of the ImageAndTextTileBinding
        }
    }
Beispiel #2
0
    protected void RadTileList1_OnTileCreated(object sender, TileListEventArgs e)
    {
        //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
        RadImageAndTextTile tile = e.Tile as RadImageAndTextTile;

        if (!object.Equals(tile, null))
        {
            tile.ImageWidth = 150;
        }
    }