ASP 2.0 Gridview vs. DataGrid

  • Thread starter Thread starter maflatoun
  • Start date Start date
M

maflatoun

Hi everyone,

I know when you enable paging in a datagrid the entire data is read but
only the data that you want is displayed to the end user. Has this
changed for Gridview? So if you have 10000 records and you only want 20
records displayed, does it read all 10000 and display 20 or does it
only read what it needs (Read 20 and display 20)?

Thanks
MA
 
The cornerstone to this is that it gets the data through an IEnumerable
interface, which means that it can only see a current item and go to the next
item. Therefore, if you want page 4, 20 records per page, 10000 records
total.....here's what happens:

When Databainding...
go forward 20*3 Items
for 20 items.....create a grid row
go forward till you hit the end so that you know how many records exist
done

(BTW, check out the Reflector tool....that's how I was able to figure this
out)
 
Back
Top