Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to assign a value to label inside the grid view Footer Templete from C# please help me



thanks in advance
Meganathan
Posted
Updated 29-Feb-12 21:47pm
v2
Comments
ZurdoDev 29-Feb-12 8:16am    
What have you tried so far?
Sergey Alexandrovich Kryukov 29-Feb-12 23:37pm    
Why it's a problem? Why doing so? What did you try?
--SA
Anuja Pawar Indore 1-Mar-12 4:16am    
If you expect correct answer, state your problem correctly. So that Dev's can help you in right direction

1 solution

Dear Friend,

Try this:-

1). First add a tag inside the gridview
<footertemplate>
  <asp:label id="lblText" runat="server" xmlns:asp="#unknown"></asp:label>
</footertemplate>


2). Then in the gridrowdatabound event:-
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
  if (e.Row.RowType == DataControlRowType.Footer)
  {
      Label lblText=(Label)e.row.Findcontrol("lblText");
      lblText=[Your Value];
  }
}       


I hope this helps you out. Don't forget to mark this as your answer if it solves your purpose.

Thanks
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900