Announcement

Collapse
No announcement yet.

RowCount anzahl von datensätzen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • RowCount anzahl von datensätzen

    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

  • #2
    Wie wäre es, wenn Du die Anzahl von Datensätzen Deiner DataSource nimmst.
    Gruss

    Mirko

    Mappen statt hacken mit dem .NET O/R Mapper Invist

    Comment

    Working...
    X