This article will explain you how to find the Repeater Header and Footer template details.
I had created one user control which contain the Repeater. It generate the product showcase. i used that control in multiple pages but some where i need to update few details like header title , footer text at run time and that i have achieved it through find control.
Below example can helps you to understand the clear idea.
<asp:Repeater ID="ProductsDetails" runat="server">
<asp:Label ID="lblProductDetails" runat="server" Fore-Color= "Red" Font-Bold = "true" />
Product Name : <%#Eval("Name") %> <br />
<asp:Label ID="lblPriceDetails" runat="server" Fore-Color= "Green" Font-Bold = "true" />
Here i have define repeater control along with header & footer details , now i want to change the text of label called "lblProductDetails" at run-time. below snippets will helps you to get the Repeater details and base on that you can easily find the footer & header controls and change the text.
Control TempHeaderDet = ProductsDetails.Controls.Controls;
Label lblHeaderDet = TempHeaderDet.FindControl("lblProductDetails") as Label;
lblHeaderDet.Text = "Product Description :";
Control FooterTemplateDet = ProductsDetails.Controls[ProductsDetails.Controls.Count - 1].Controls;
Label lblFooterDet = FooterTemplateDet.FindControl("lblPriceDetails") as Label;
lblFooter.Text = "Product Price:";
Yeap, i know its not very big deal... but yes some time this trick will helps you and save time as well.
put your comments/ question in case of any concerns.