-
Jeud: Adding total field to DataGrid
Dear All.
I'm having problem on creating a DataGrid with some total fields at the
bottom area of the grid.
Inside the <asp ataGrid> tag, I have assigned an event handler as follow
....
OnItemDataBound="MyDataGrid_ItemDataBound"
....
This is what MyDataGrid_ItemDataBound looks like.
Sub MyDataGrid_ItemDataBound(Sender As Object, E As DataGridItemEventArgs)
If (E.Item.ItemType = ListItemType.Item) Or (E.Item.ItemType =
ListItemType.AlternatingItem) Then
'I was noticed that E.Item.Cells(1) is still blank here, therefore I
just couldn't retrieve any value for my calculation sub routine
MyCalculationSubRoutine(E.Item.Cells(1).Text)
Else
'I plan to assign the total back to footer this way
'E.Item.Cells(1).Text + String.Format("{0:c}", GrandDailySales)
End If
End Sub
My question is that how to get the value from E.Item.Cells(1) on each row ?,
because I have to pass the value I read to MyCalculatioSubRoutine for
calculating the total.
Actually I got this coding idea from MSDN, but why my one isn't working?
Is it because I placed the coding at the wrong event, or whatever?
Please anyone suggest me what to do, I don't mind if I have to entirely
change the way to code this page to make this all work out.
Thanks.
TJeudSanit
* Preferably is vb.
** I'm actually using simple text editor to code my asp.net pages.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks