Hallo, wer kann mir weiter helfen?
möchte im footer die Anzahl der datensätze"NummerID" zusammen zählen!
so wie ich es jetzt habe werden die datensätze summiert, wie mache ich es mit der ANZAHL
NummerID += (Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"NummerID")))
Sub GridView1_RowDataBound(ByVal sender As Object, _
ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
' add the UnitPrice and QuantityTotal to the running total variables
Expr1 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"Expr1"))
NummerID += (Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"NummerID")))
ElseIf e.Row.RowType = DataControlRowType.Footer Then
' for the Footer, display the running totals
e.Row.Cells(1).Text = Expr1.ToString("c")
e.Row.Cells(0).Text = NummerID.ToString("f")
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Font.Bold = True
End If
End Sub
End Class
möchte im footer die Anzahl der datensätze"NummerID" zusammen zählen!
so wie ich es jetzt habe werden die datensätze summiert, wie mache ich es mit der ANZAHL
NummerID += (Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"NummerID")))
Sub GridView1_RowDataBound(ByVal sender As Object, _
ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
' add the UnitPrice and QuantityTotal to the running total variables
Expr1 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"Expr1"))
NummerID += (Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"NummerID")))
ElseIf e.Row.RowType = DataControlRowType.Footer Then
' for the Footer, display the running totals
e.Row.Cells(1).Text = Expr1.ToString("c")
e.Row.Cells(0).Text = NummerID.ToString("f")
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Font.Bold = True
End If
End Sub
End Class
Comment