Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Rows the rows of a grid view?

Thread Tools

Rows the rows of a grid view?

Jason James
Posts: n/a

I would like to do this:

Dim r As GridViewRow
Dim nTotal As Single = 0
For Each r In GridView1.Rows
If IsNumeric(r.Cells(2)) Then
nTotal += CType(r.Cells(2).Text, Single)
End If
Label1.Text = "Total vouchers bought is " & nTotal.ToString

to sum the numbers in column 2 and place the total into Label1.

However, the rows collection doesn't appear to have any rows in it. It
does have rows and they are displayed.

Any ideas how I achieve this goal and in which event I should process
the rows?

Many thanks,


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a container to hold grid positions and the objects on the grid? Simon L C++ 3 03-31-2006 03:38 PM
Grouped grid? Or grid within datalist? Danny Tuppeny ASP .Net 1 10-27-2005 10:03 PM
How to transfer a value from an Invisible Grid to an visible Grid =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?= ASP .Net 2 10-17-2005 03:56 AM
Grid within a Grid ItemDataBound event problem Girish ASP .Net 4 07-19-2005 01:17 AM
Grid question: How do I force grid elements to expand and use available space Marc Python 0 10-08-2003 05:06 PM