Either I am not understanding what you want, or you are missing a few concepts.
If you're not using paging, the DataGrid displays all records. Thus, the Items.Count returns all records currently displayed in the grid.
If you want to know all the records in the initial data source, ask the datasource ;)
Suppose you create a dataset with a query like this:
SELECT Col1, Col2 FROM YourTable WHERE SomeCriteria = SomeValue.
Let's say your *database* table holds 100 records, and that 20 are returned by this query. Let's also say your Grid has a PageSize of 10
returns 20, as that is the number of records in a *DataTable* inside the DataSet, not the total number of records in the table in the *database*.
MyDataGrid.Items.Count returns 10
SELECT COUNT(*) FROM YourTable
So, now you can count whatever you want: items in the grid (Items.Count), items in the datasource (Tables(0).Rows.Count) or items in the database table (SELECT COUNT(*) FROM YourTable)
Is there anything more to count??
Everyone is unique, except for me.
While typing this post, I was listening to: You Think I Ain't Worth A Dollar, But I Feel Like A Millionaire
by Queens of the Stone Age
(Track 2 from the album: Songs For The Deaf
) What's This?