私は次の操作を実行しよう:MultiPage Gridviewで行数を取得しますか?
lblTotal.text = gwGrid.rows.count()
は、私はいつも私のページのサイズである、50を得ます。その1ページに表示されるレコードだけでなく、返されるすべてのレコードの数を取得するにはどうすればよいですか?
は、私も自分のデータソース上で選択したイベントを試してみました: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
が、私は次のエラーを取得:オブジェクトのインスタンスに設定されていない
オブジェクト参照を。 ライン85:Dim totalRecordCount As Integer = dt.Rows.Count
UDPATE:私はそれを把握:この行の
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
+10もしできれば!非常にシンプルで、とても働きます! – Marcel