when i try to do the following:
lblTotal.text = gwGrid.rows.count()
i always get 50, which is the size of my page. how can i get the count of ALL records returned, not just the ones displayed on that one page?
i also tried the Selected event on my datasource:
Protected Sub ObjectDataSource1_Selected(ByVal sender As Object, ByVal e As ObjectDataSourceStatusEventArgs)
If e.Exception Is Nothing AndAlso e.ReturnValue IsNot Nothing Then
Dim dt As DataTable = TryCast(e.ReturnValue, DataTable)
Dim totalRecordCount As Integer = dt.Rows.Count
End If
End Sub
but i get the following error:
Object reference not set to an instance of an object.
on this line:
Line 85: Dim totalRecordCount As Integer = dt.Rows.Count
udpate: i figure it out:
Protected Sub ObjectDataSource1_Selected(ByVal sender As Object, ByVal e As ObjectDataSourceStatusEventArgs)
If e.Exception Is Nothing Then
Dim dt As DataSet = DirectCast(e.ReturnValue, DataSet)
If dt IsNot Nothing Then
lblTotal.Text = dt.Tables(0).Rows.Count.ToString()
Else
lblTotal.Text = "0"
End If
End If
End Sub