Rad Tilelist Server-side click event Primary Key?

3 posts, 0 answers
  1. Johann
    Johann avatar
    9 posts
    Member since:
    Mar 2011

    Posted 04 Nov 2014 Link to this post

    Hi There

    I'm using a RadTileList to display a range of items from a SQL DB.
    I want each tile to link to a certain (the same) page and also provide the "ID" field of that item in a querystring. But I'm not sure how to accomplish this.

    So I currently have this:
    <telerik:RadTileList runat="server" ID="tileListSticky" AppendDataBoundItems="true" RenderMode="Classic"
                    Width="100%" TileRows="4" OnTileDataBound="RadTileList1_OnTileDataBound" OnTileCreated="RadTileList1_OnTileCreated" Skin="Sunset" ScrollingMode="Auto" SelectionMode="Single" AutoPostBack="true" OnTileClick="tileListSticky_TileClick">

    Importantly, the "OnTileClick" part fires an event, but I'm not sure how to go about getting the "ID" field of the item in the DB. It's not specifically bound to the tile either.


  2. Johann
    Johann avatar
    9 posts
    Member since:
    Mar 2011

    Posted 04 Nov 2014 in reply to Johann Link to this post

    Ok, looks like I succeeded finally.

    By adding a button to the "Peek" template like this:

    <div class="peekTemplateClass">
        <strong>Date Published:</strong>
        <asp:Label Text='<%# DataBinder.Eval(Container.DataItem, "dateon")%>' runat="server" />
        <br />
        <strong>Number of Attachments:</strong>
        <asp:Label Text='<%# DataBinder.Eval(Container.DataItem, "ATTCOUNT")%>' runat="server" />
        <br />
        <asp:Button Text="Read It!" CssClass="btn btn-primary btn-sm" ID="btnClickArt"
       CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id")%>' OnClick="btnClickArt_Click" runat="server" />

    I'm then able to easily get the "ID" field using the CommandArgument of the button (sender) and do whatever I like with it.
  3. Otoniel
    Otoniel avatar
    1 posts
    Member since:
    Dec 2015

    Posted 16 Dec 2019 in reply to Johann Link to this post

    Hi. Could you please share the server-side code to get the ID field value?


Back to Top