Click here to Skip to main content
15,936,171 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to add a data to a single cell in footer. how to bind that data plz help me.

SqlDataAdapter add = new SqlDataAdapter("select sum(Total) from tblQuotationreg",con);
              DataTable dt = new DataTable();
              GridView1.DataSource = dt;

this is the code i tried im having 6 columns and footer in my gidview i want to add the total and display it in my footer particularly in my column 6.

This is the error occur while running the above code::

'string' does not contain a definition for 'DataBind' and no extension method 'DataBind' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
Updated 24-Mar-12 0:34am

1 solution

hi , 
use this it will help .

<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

Label lb = ((Label)GridView1.FooterRow.FindControl("Label2")); ;
lb.Text = "123";
Share this answer
Mohamed Mitwalli 24-Mar-12 11:40am    
did it help you

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