K
KatB
Hi, in order to format my web page, I'm starting to use Flow layout so
using html tables to space out controls, etc. When using grid layout,
the following worked when it was just a datagrid. I know I need to
somehow refer to the datagrid within the html table cell, but can't
figure out how.
THANKS!
Public Sub dgConfirmOrder_ItemDataBound(ByVal sender As System.Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgConfirmOrder.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem, ListItemType.Item
'Calculate total for the field of each row and alternating row.
myTotal += CDbl(e.Item.Cells(3).Text)
'Format the data, and then align the text of each cell to the right.
e.Item.Cells(3).Text = Format(CDbl(e.Item.Cells(3).Text),
"##,##0.00")
e.Item.Cells(3).Attributes.Add("align", "right")
Case ListItemType.Footer
'Use the footer to display the summary row.
e.Item.Cells(2).Text = "Total"
e.Item.Cells(2).Attributes.Add("align", "left")
e.Item.Cells(3).Attributes.Add("align", "right")
e.Item.Cells(3).Text = myTotal.ToString("c")
End Select
End Sub
Thanks, Kat
using html tables to space out controls, etc. When using grid layout,
the following worked when it was just a datagrid. I know I need to
somehow refer to the datagrid within the html table cell, but can't
figure out how.
THANKS!
Public Sub dgConfirmOrder_ItemDataBound(ByVal sender As System.Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgConfirmOrder.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem, ListItemType.Item
'Calculate total for the field of each row and alternating row.
myTotal += CDbl(e.Item.Cells(3).Text)
'Format the data, and then align the text of each cell to the right.
e.Item.Cells(3).Text = Format(CDbl(e.Item.Cells(3).Text),
"##,##0.00")
e.Item.Cells(3).Attributes.Add("align", "right")
Case ListItemType.Footer
'Use the footer to display the summary row.
e.Item.Cells(2).Text = "Total"
e.Item.Cells(2).Attributes.Add("align", "left")
e.Item.Cells(3).Attributes.Add("align", "right")
e.Item.Cells(3).Text = myTotal.ToString("c")
End Select
End Sub
Thanks, Kat