Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
How to access Label inside FooterTemplate?
posted

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();

((

 

Label)PAGrid.Columns[OracleDBSchema.Tables.PerfAlertsGrid.NonGroup

 

 

._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

Parents
No Data
Reply
  • 49378
    posted

    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.

Children