I am binding a gridview using SqlDataSource and I am assigning the SQL select command from code behind to SqlDataSource . I have also enabled pagination in my GridView with page size 25.
Now what I want to know is if I am assigning query from code behind then does SqlDataSource takes care of pagination. I mean it should fetch 25 records at a time based on the selected page number.
I am concerned because my GridViewis showing data too slow and I feel that SqlDataSource is fetching all 9174 records (result set of my query) and displaying first 25 of them in first page. When I switch to second page it looks like it is fetching all 9174 records again and showing next 25 records.
Can anyone help me to understand if what I am assuming is correct or the flow in my case is different.