7 Answers, 1 is accepted
You can use a RadBinaryImage control in a ContenTemplate Tile: http://docs.telerik.com/devtools/aspnet-ajax/controls/tilelist/tiles/contenttemplate-tile.
Alternatively, you can create a generic handler that will take the image from your database and return it as a file, and point the ImageUrl property of the Tile to that handler, with the appropriate querystring so the handler can know which image to return.
Thank you , I am trying to avoid one more layer by introducing a handler
This is what I have tried but its still not working
<telerik:RadTileList runat="server" ID="RadTileList1" DataSourceID="SqlDataSource1" Height="500px" TileRows="3" AutoPostBack="true" OnTileClick="RadTileList1_TileClick"
<%-- <CommonTileBinding TileType="RadImageTile" DataTitleTextField="Name" DataNameField="Description" Shape="Wide"/> --%>
<asp:Image ID="Image2" runat="server" Height="109px" Width="194px" AlternateText="Video Thumbnail"
ImageUrl='<%# "data:image/png;base64,"+ Convert.ToBase64String((byte)(Eval("Image"))) %>' />
<asp:Label ID="Label3" runat="server" CssClass="timeLabel" Text='<%# DataBinder.Eval(Container.DataItem,"Name") %>'></asp:Label>
<%-- <ImageTileBinding DataImageUrlField="Image" />--%>
<div class="productNamePeek"><%# DataBinder.Eval(Container.DataItem,"Description") %></div>
Such data binding expressions are not evaluated by the TileList at this point. I have created a page where you can monitor this feature's progress: http://feedback.telerik.com/Project/108/Feedback/Details/169080.
In the meantime, you can use the TileDataBound event: http://docs.telerik.com/devtools/aspnet-ajax/controls/tilelist/server-side-programming/events/ontiledatabound. Here is an example:
note that the tile type is set to ContentTemplateTile as otherwise it will default to TextTile: because I do not see a field that sets this
Here is some simplistic data binding:
and the dummy data which should produce a red square for the image field (my sample gets directly a base64 string, you can use your existing methods):
and the TileDataBound event that can pass this final string to the image src:
Regards, Marin Bratanov
Thank you so much
I tried but ran into a minor issue with byte and string , for some reasons I was just getting System.byte rendered for the image, there must be a simple fix for thatAnd also is there a way we could add animations to TilePeekTemplate , I know that we can add animation via PeekTemplateSettings but not sure how to do it with TilePeekTemplate
You can add specific settings for each tile in the OnTileCreated event: http://docs.telerik.com/devtools/aspnet-ajax/controls/tilelist/server-side-programming/events/ontilecreated.
Thank you so much, is there a way to set a mouse hover image on a peek ?