AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 gridviewprint
Posted by jimson j fernandez on  11/2/2008 7:17:47 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
in a datagridview dynamically changeing rows
how datagridview columns values sum in footer

Post Your Reply Post New Question

 Viewer's Reply
Do like this
Answered By Moderator1 on 11/4/2008 7:42:41 AM
Declare a page scope varible.

double dblSum=0;

In the RowDataBound of the GridView control,

if (e.Row.RowType == DataControlRowType.DataRow)
{
dblSum+= Convert.ToDouble(e.Row.Cells[0].Text);
}

if (e.Row.RowType == DataControlRowType.Footer)
{
YourLabelControl.Text=dblSum.ToString();
}
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Speech Technology Magazine
Integrating Silverlight 4 with SharePoint 2010 - Free 42 Page Sample Chapter
The Beginner's Guide to Joomla