This is a migrated thread and some comments may be shown as answers.

Find Link button in RadListView ItemTemplate to set Ajax Settings on Page Load event

2 Answers 189 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Ravi Kumar
Top achievements
Rank 1
Ravi Kumar asked on 05 Mar 2011, 10:26 AM
Hi,

I have a link buttin in radlistview  itemtemplate. on click on link buttom i,m loading another list.it is happening fine but spin wheel is not showing when i click on the link button. please suggest what is going wrong.

      <telerik:RadListView ID="lvLaborHoursSummary" runat="server" DataKeyNames="ID" >
                                <LayoutTemplate>
                                    <div>
                                        <table id="chart1" border="0" cellspacing="0" style="width: 100%;">
                                            <thead>
                                                <tr>
                                                    <td colspan="8" align="center">
                                                        <b>Labor Hours by Site</b>
                                                    </td>
                                                </tr>
                                         </thead>
                                            <tbody>
                                                <tr id="itemPlaceholder" runat="server">
                                                    <td>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="lnkDescription" runat="server" Text='<%# Eval("Description") %>'
                                                CommandName="ShowSummaryByEmployee"></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
*********************************************************************************************
       How to find lnkDescription button on page load event to set ajax settings
        ajaxManager.AjaxSettings.AddAjaxSetting(lnkDescription, pnlLaborHoursSummary, RadAjaxLoadingPanelLaborHoursSummary);


Thanks
~Ravi

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Mar 2011, 09:53 AM
Hello Ravi,

Check out the following code snippet to get LinkButton in ItemTemplate.

C#:
protected void Page_Load(object sender, EventArgs e)
   {
       foreach (RadListViewDataItem item in RadListView1.Items)
       {
           LinkButton btn = (LinkButton)item.FindControl("lnkDescription");
       }
   }

-Shinu.
0
Ravi Kumar
Top achievements
Rank 1
answered on 08 Mar 2011, 12:40 AM
Thank you very much Shinu.
Tags
ListView
Asked by
Ravi Kumar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ravi Kumar
Top achievements
Rank 1
Share this question
or