Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2004, 10:00 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Summary in footer

Hi all

Have anyone know the way to summary every row in datagrid to datagrid's footer
I try to use this code but it didn't show anything

****************************

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Page.IsPostBack = False Then
            Header.Text = "Review Your Product In Cart"

            ' Calculate end-user's shopping cart ID
            Dim cart As VCDeasy.ShoppingCartDB = New VCDeasy.ShoppingCartDB
            Dim cartId As String = cart.GetShoppingCartId()

            ' Populate datagrid with shopping cart data
            MyDataGrid.DataSource = cart.GetItems(cartId)
            MyDataGrid.DataBind()

            ' Update total price label
            TotalLbl.Text = "Total : " & String.Format("{0:c}", cart.GetTotal(cartId))
            MyDataGrid.Item.Cells(1).Text = "Total: " & String.Format("{0:#,###}", cart.GetTotal(cartId))
        End If

*************************************
cart.GetTotal(cartId)) is my function that calculate the summary value

How can i solve this problem?

Thanks in advance

Blueman137

 
Old March 30th, 2004, 06:48 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Usually you would do this with the datagrid's ItemCreated handler. In the method that handles that event, you can test e.Item for "Footer" and then access the cell where you want to write the total string.





Similar Threads
Thread Thread Starter Forum Replies Last Post
validation summary MunishBhatia ASP.NET 2.0 Professional 1 May 11th, 2007 08:00 AM
getting summary in a stored procedure smiter SQL Server 2000 1 April 24th, 2007 05:37 PM
Not getting correct summary total arcadehunter BOOK: Professional Crystal Reports for VS.NET 0 November 8th, 2006 02:23 AM
help with summary tags in .net nekblood VS.NET 2002/2003 0 July 9th, 2003 01:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.