473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

add Another row to GridView Footer-

Hi

This code works great but it only adds the one row. I need a second one.
How?

Thanks!
Protected Sub grdExcel_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs)

If e.Row.RowType = DataControlRowType.DataRow Then

' add the UnitPrice and QuantityTotal to the running total variables

SUM_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _

"AMOUNT"))

CANCEL_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _

"CANCEL_AMOUNT"))

ElseIf e.Row.RowType = DataControlRowType.Footer Then

e.Row.Cells(3).Text = "Totals:"

' for the Footer, display the running totals

e.Row.Cells(4).Text = SUM_AMOUNT2.ToString("c")

e.Row.Cells(5).Text = CANCEL_AMOUNT2.ToString("c")

e.Row.Cells(6).Text = (SUM_AMOUNT2 - CANCEL_AMOUNT2).ToString("c")
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right

e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right

e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right

e.Row.Font.Bold = True
End If

End Sub
Feb 9 '06 #1
1 4737
The GridView is limited to a single footer row.

--

Andrew Robinson
http://blog.binaryocean.com
"NewTel" <dd**@dimdddabot.com> wrote in message
news:Da********************@comcast.com...
Hi

This code works great but it only adds the one row. I need a second one.
How?

Thanks!
Protected Sub grdExcel_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs)

If e.Row.RowType = DataControlRowType.DataRow Then

' add the UnitPrice and QuantityTotal to the running total variables

SUM_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _

"AMOUNT"))

CANCEL_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _

"CANCEL_AMOUNT"))

ElseIf e.Row.RowType = DataControlRowType.Footer Then

e.Row.Cells(3).Text = "Totals:"

' for the Footer, display the running totals

e.Row.Cells(4).Text = SUM_AMOUNT2.ToString("c")

e.Row.Cells(5).Text = CANCEL_AMOUNT2.ToString("c")

e.Row.Cells(6).Text = (SUM_AMOUNT2 - CANCEL_AMOUNT2).ToString("c")
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right

e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right

e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right

e.Row.Font.Bold = True
End If

End Sub

Feb 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
0
by: tfsmag | last post by:
I know how to do summary footers in a gridview... but when i try it in a paged gridview it puts a footer on every page of just the items on that page. Any suggestions on how to get it to work so...
1
by: Stu Lock | last post by:
Hi, I've spent the last hour trawling google for this - but all I find are people asking the same question! I have a gridview which is being databound to an empty datasource. I can display...
13
by: AG | last post by:
I have a gridview that I bind to a List(of Type) at runtime. Not using a datasource control. The gridview has a template column with an imagebutton whose commandname is set to 'Delete'. The...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have to display total time in the footer of my gridview so I have a columnn a. I followed micrososft example to create the footer and display the total time and it is not...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have a gridview. I calculated some values in the gridview for the footer of the gridview so basically I am adding all the values that are displayed in the gridview for each...
0
by: gnewsgroup | last post by:
Well, I am trying to use the footer row of a GridView for insertion purpose. There are some articles about this, for example, the gridviewguy.com has an example, which always displays the footer...
2
by: shapper | last post by:
Hello, I am working with a ListView but I suppose that with a GridView might be the same. Instead of having an Insert Button on each GridView row I would like to have only one Insert button,...
3
by: tshad | last post by:
I am building a GridView that is displaying some money values in 3 columns. I want to put the totals of each column in a label field (one for each column) in the footer. I was trying to figure...
1
by: Michael | last post by:
I reviewed a couple of tutorials that show how to display totals in the footer of a gridview. My footer shows up blank. Can someone help me. The code is as follows: <%@ Page Language="VB" %>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.