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

Find a control in Footer template

1 Answer 267 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gajanan
Top achievements
Rank 2
Gajanan asked on 08 Jul 2010, 11:34 AM
Hi there,

I'm using new Rad Controls.

I want to find a button in the footer template on Button Click event, which is outside the grid.

If anybody is aware of the solution ?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Jul 2010, 12:00 PM
Hello Gajanan,

You can try the following code snippet to access the Button inside FooterTemplate.

ASPX:
<telerik:GridTemplateColumn>
      <FooterTemplate>
           <asp:Button ID="Button1" runat="server" Text="Button" />
       </FooterTemplate>
 </telerik:GridTemplateColumn>

C#:
protected void Button2_Click(object sender, EventArgs e)
   {
       GridFooterItem footerItem = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
       Button btn = (Button)footerItem.FindControl("Button1");//accessing Button inside FooterTemplate
   }

Thanks,
Princy.
Tags
Grid
Asked by
Gajanan
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or