Creating image tiles in codebehind - how set the name / title

3 posts, 1 answers
  1. Hugo
    Hugo avatar
    5 posts
    Member since:
    Jun 2013

    Posted 02 Jul 2013 Link to this post

    Hi all,

    We're using the tilelist control and trying to create the tiles in the codebehind and so far we built the tiles and show them on the page.
    We want to also show a title / text for each title, we're trying to do this by mimic the markup with c# code.

                <telerik:RadImageTile Name="Istanbul" ImageUrl="../images/Tiles/Wide/Istanbul.png" Shape="Wide"
                    NavigateUrl="http://en.wikipedia.org/wiki/Istanbul" Target="_blank">
                    <Title Text="Istanbul"></Title>
                    <PeekTemplateSettings AnimationDuration="700" ShowInterval="6000" CloseDelay="4000"
                            Animation="Fade" Easing="easeInQuint" ShowPeekTemplateOnMouseOver="true" 
                        HidePeekTemplateOnMouseOut="true" />
                </telerik:RadImageTile>

    Our issue here is that we aren't able to add the Title on the RadImageTile control. We've already tryed the:
    1. Title property on the RadImageTile, 
    2. Name property on the RadImageTile
    3. Adding the TileTitle control to the RadImageTile child controls (the tiletitle doesn't inherit from control).

    How can we achive this?

    Thanks and regards,
    Hugo Figueira
  2. Hugo
    Hugo avatar
    5 posts
    Member since:
    Jun 2013

    Posted 02 Jul 2013 Link to this post

    We've solved this by using RadImageAndTextTile instead of RadImageTile.
    The RadImageAndText has a property Text that puts the text in the Tile.

    Thanks so much for the time.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 04 Jul 2013 Link to this post

    Hello Hugo,

    The Title and Badge inner tags in th markup correspond to classes in the code-behind, so here is how you would set server-side properties of the control:
    RadImageTile tile = new RadImageTile();
    tile.ImageUrl = "someImage.png";
    tile.Title.Text = "title text";
    tile.Badge.Value = 123;
    tile.PeekTemplateSettings.ShowPeekTemplateOnMouseOver = true;

    The full API exposed by the tiles is available here: http://www.telerik.com/help/aspnet-ajax/tilelist-server-side-tile-object.html.

    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top