RadTileList not sending TileClick event

1 Answer 25 Views
TileList UI for ASP.NET AJAX in ASP.NET MVC
loic
Top achievements
Rank 1
Iron
loic asked on 11 Mar 2022, 01:11 PM

Hello, I have a RadTileList in my page in which I add Tiles in the code behind. I need to know when a tile is clicked.

The problem is that the click event is only sent when I click on a tile created in aspx, not in the code behind.

When I click on a tile created and added to the RadTileList in the code behind, nothing happens.

I also tried to add a click event to the tile itself, but that didn't help.

 

RadTileList :

<telerik:RadTileList RenderMode="Mobile" SelectionMode="Single" runat="server" ID="RadTileList1" Style="max-height: 900px" OnTileClick="SupportTile_Click" OnSelectionChanged="SupportTile_Click" AutoPostBack="true">
    <Groups>
        <telerik:TileGroup Title="Supports">
            <telerik:RadContentTemplateTile runat="server" Shape="Wide" Height="100%">
                <ContentTemplate>
                    <div class="row">
                        <div class="col" style="max-width: 4%">No.</div>
                        <div class="col" runat="server" style="max-width: 15%; border: solid 1px black; text-align: center;">
                        </div>
                        <div class="col" style="max-width: 10%">Status</div>
                        <div class="col" runat="server" style="max-width: 33%; border: solid 1px black; text-align: center;"></div>
                    </div>

                    <br />

                    <div class="row">
                        <div class="col" style="max-width: 14%">Barcode</div>
                        <div class="col" runat="server" style="max-width: 64.2%; border: solid 1px black; text-align: center;"></div>
                    </div>

                    <br />

                    <div class="row">
                        <div class="col" style="max-width: 7%">Four</div>
                        <div class="col" runat="server" style="max-width: 30%; border: solid 1px black; text-align: center;"></div>
                        <div class="col" style="max-width: 13%"></div>
                        <div class="col" style="max-width: 5%">Actif</div>
                        <div class="col" style="max-width: 4%">
                            <asp:CheckBox Checked="true" runat="server"></asp:CheckBox></div>
                    </div>
                </ContentTemplate>
            </telerik:RadContentTemplateTile>

        </telerik:TileGroup>
    </Groups>
</telerik:RadTileList>

Tile insertion in code behind :


RadContentTemplateTile rctt2 = new RadContentTemplateTile();
rctt2.Shape = TileShape.Wide;
rctt2.Click += SupportTile_Click;
rctt2.AutoPostBack = true;
RadTileList1.Groups[0].Tiles.Add(rctt2);


protected void SupportTile_Click(object sender, EventArgs e){}

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 16 Mar 2022, 09:56 AM

Hello loic,

Can you elaborate in which moment of the page life-cycle you are adding the dynamically created tiles? Can you move the rctt2 creation to the Page_Init event-handler and see if the problem persists?

    protected void Page_Init(object sender, EventArgs e)
    {
        RadContentTemplateTile rctt2 = new RadContentTemplateTile();
        rctt2.Shape = TileShape.Wide;
        rctt2.Click += SupportTile_Click;
        rctt2.AutoPostBack = true;
        RadTileList1.Groups[0].Tiles.Add(rctt2);
    }

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TileList UI for ASP.NET AJAX in ASP.NET MVC
Asked by
loic
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or