Hi All
I hope I have found the correct spot to ask this question. I am using C#.Net and I have a gridview to display data from sql server. I want to be able to give the gridview the total count of rows but only return 50 rows from SQL Server.
If you connect a gridview to a datasource (query) and set the pagesize lower than the number of returned rows it will automatically paginate for you. If I were to return say 300 rows and have a page size of 50 then I would get 6 pages. But in my case I want to use the gridview pageindex to return the correct set of rows via ROW_NUMBER().
For this example returning 300 vs 50 rows really isn't much of a difference. But lets say you had 1,000,000 rows. Why pass all these rows to then only display 50?
So back to my original question how do I pass both the 50 rows and the total number of rows to the datagrid view?