None
None

Reputation: 5670

Gridview improving perfomance?

i have a gridview in my page and a datatable with 1000 rows in it .now i can bind gridview with datatable intwo different ways

  1. bind datatable directly to gridview.
  2. create another datatable with first ten rows and bind it to grid. on the next page request bind next 10 rows to gridview.

now my question is, does my second aproach really help me to improve perfomance of the page?

Upvotes: 0

Views: 913

Answers (1)

Tim Schmelter
Tim Schmelter

Reputation: 460098

There are two ways to improve the performance in this case:

  1. Enable paging in your GridView

    • Advantage: easy to implement, you don't need to change your DataSource

    • Disadvantage: You need to select all records from dbms

  2. Page the DataSource itself(f.e. SQL-Server)

    • Advantage: Very fast and scalable

    • Disadvantage: More time-consuming to implement

With only 1000 rows i would recommend to enable paging in GridView.

Upvotes: 3

Related Questions