.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

sum of 7 column totals in footer of gridview

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :ASP.Net
I have implemented column tolals in the footer of my gridview using the technicque described in this article http://aspalliance.com/782 .Now I would like to have a total of the 7 column totals that are displayed in the footer.  Can anyone tell me how to do this.  I would like to display this in a label or an addition row in the footer if that is possible.

View Complete Post

More Related Resource Links

Gridview Totals in Footer

 I am having problems with displaying the totals in the footer of a gridview. I am writing a page whereby users can enter comments and marks for an online photo competition. The page has a details view to enter the comment and mark. Its has a details view where the photo is displayed. It has a gridview where the comments and marks that have been entered are displayed. It works well - the details view allows comment and mark entry and the gridview show the comments and marks as they are entered. The problems are twofold. Firstly the total shows double the marks that should be displayed. Secondly, when you leave the page and then return later, you have to refresh the page before it will show the latest comment and mark even though it shows this immediately after entering the data. Ive provided my code below:   Partial Class PhotoAlbum_PhotoDetails     Inherits System.Web.UI.Page     Private TotalMarks As Decimal     Protected Sub DisplayComment_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles DisplayComment.RowDataBound         If e.Row.RowType = DataControlRowType.DataRow Then             TotalMarks += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Mark"))   

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

How to Fixed GridViews Header and Footer when scrolling in asp.net?

This article is to show you how to Fix GridView''s Header and Footer in a simple code with CSS and JavaScript

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Use a column as parameter for a sds in another column; gridview


Hola, I have a gridview which is bound to a sds which returns 7 columns and I added two columns from the GUI.  What I want is to fill up the 9th column with DDLs and these  DDLS will get their data from a different sds which is using a stored procedure with a single parameter.  I created the 9th row, used template field, made the sds for 9th row, the stored_procedure, threw a DDL in Item template and all  I need now is to pass a parameter in the first column to the sds in the 9th column.  I can code this but i'm getting tired of aspx.cs :) and would like to do it from the GUI.

Rendering data with HTML tags in the DD Gridview for a selected column


I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

            if (e.Row.RowType == DataControlRowType.DataRow)
                // Html Encode the cells


but this event never fires?

Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!

inserting from gridview footer


I have been following the tutorials from Scott Mitchell on this site.  I am trying to insert a new record from the gridview footer.  I have my BLL set up as a .cs class in the App Code folder.  When I fill in the fields and click add, nothing happens.  The page refreshes and the text boxes empty, but nothing is added to the database.  The edit and delete functions work fine.  Have I put something in the wrong spot?


I have the rowcommand and the datasource_inserting on the code page as below.

protected void Oems_RowCommand(object sender, GridViewCommandEventArgs e)
    // Insert data if the CommandName == "Insert" 
    // and the validation controls indicate valid data...
    if (e.CommandName == "Insert" && Page.IsValid)
        // TODO: Insert new record...

protected void OemsDataSource1_Inserting
(object sender, ObjectDataSourceMethodEventArgs e)
    // Programmatically reference Web controls in the inserting interface...
    TextBox txtOem = (TextBox)GridView1.FooterRow.FindControl("txtOem");
    TextBox txtOemStreet = (TextBox)GridView1.FooterRow.FindControl("txtOemStreet");
    TextBox txtOemCity = (TextBox)GridView1.FooterRow.FindControl("txtOemCity");

How To Access Datakeys In Javascript...and How To make gridview Column Visible true in javascript


How To Access Gridview's Datakeys In Javascript...and How To make gridview Column Visible true in javascript

Reply me..

How to set the width of column on GridView

How to set the specific the width of each column, the columns are created automaticly 

Use Data in a Column as Select Button in GridView

I don't want to use the built in "Select" hyperlink that's in the gridview, I'd like to just use the first data column, is there a way to do that or are we forced to use the automatically generated "Select" column.Thanks!

Up Down GridView Icon Image for Column Sorting

I'm trying to add an Ascending and Descending sort direction Icon Image next to the header text of my ASP.NET 2.0 Gridview Columns.I've searched and found some examples that seem to do this but have had difficult time recoding them from C# to VB or some just seemed overly complex for what I want to do.Does anyone have a simple VB solution for sort icons?Thanks,Ethan   

SSRS 2008 group footer totals on a new page has a non-expected large cell height

SSRS 2008 group footer totals on a new page has a non-expected large cell height. When the group total is the first component on a new page, then this happens, but when it is part of the group on but not the first component, then it reverts to normal cell height. I have played with the advance settings now for hours, but cannot get this to work. Any ideas?  

Footer and Header in Empty GridView

How to make GridView to show Header and Footer when it hasn't got any rows?

convert column into hyperlink in gridview

hi how can i convert column in grid view into hyperlink  thanks

Is possible...? set enter key button for gridview footer template..

http://geekswithblogs.net/dotNETvinz/archive/2009/06/04/adding-dynamic-rows-in-gridview-with-textboxes.aspxI have used the above grid view in my application . Its working good, no problem. Upon clicking the Addnewrowbutton, it uses to create a new row dynamically. What i need is, new row should also be created dynamically, upon pressing enter key in the last textbox on a particular gird view row.  User always can't go and click addnewrowbutton every time to create new row. Instead of it, user can press enter in the last textbox on a particular grid view row to create new row. Hope you guys have understood. Please Note: Here I have used master page.

extra column gridview

Dear All; I have a gridview with the following columns pid           Location I would like to add an extra column called quantity, that could be used to get a user input. How do i go about doing that? A sample code will be very helpful. See illustration below pid          Location              quantity   All help will be greatly appreciated. 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend