Hi,
How can I access label and set the value of the label which is placed inside footertemplate dynamically in server side code?
<FooterTemplate>
<asp:Label Text="" runat="server" ID="lblTotal" CssClass=""/>
<asp:Label Text="" runat="server" ID="lblblank"/>
</FooterTemplate>
c# code
PAGrid.DataSource = ds;
PAGrid.DataBind();
((
._totalActiveIR].Footer.FindControl("lblTotal")).Text = "Dynamic".
But the code in c# is returning null.(It can not find the control.
Is there in sample code where someone have impltemented the same stuff?
Please help me out.
Thanks,
Sanjay
Hello Sanjay,
Thank you for posting in the community.
In order to access the templated footer control, the column should be cast to its precise respective field type and the templated controls accessed through the footer's template container. For instance for a BoundDataField:
((Infragistics.Web.UI.GridControls.BoundDataField)(WebDataGrid1.Columns[0])).Footer.TemplateContainer.FindControl("Label2")
Please let me know if this helps.
Please feel free to contact me if you have any further questions regarding this matter.