目前,我正在向我的网格视图添加页脚行,方法如下:
如何添加更多的页脚行,例如总折扣、总节省等,与上述类似。
Protected Sub gvShoppingCart_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles gvShoppingCart.RowDataBound
' If we are binding the footer row, let's add in our total
If e.Row.RowType = DataControlRowType.Footer Then
e.Row.Cells(5).Text = "<strong>Total Cost:</strong>"
e.Row.Cells(6).Text = ShoppingCart.Instance.GetSubTotal().ToString("C")
End If
End Sub
如何添加更多的页脚行,例如总折扣、总节省等,与上述类似。
GridViewRow
解决方案才适用于我。而其他答案中尝试使用创建新的TableRow
并不起作用(针对多个GridView页脚行)。 - liviriniu