I have a page wrote in c# with seven gridviews, each one in a different tab. On page load, i bind all the gridviews with data and using paging to reduce the amount of data of the grid.
When i change from one tabs to another one, it get a lot of seconds to show the content of the other, but the page don't do a new bind. The time is waste just to jquery ui hide the old tab and unhide the selected.
Is there anything to do to reduce this time? I think there is no reason to this delay just to hide and unhide contents.
The only way to reduce that is to reduce the number of elements that are being shown/hidden. What gridview are you using? My guess would be that the pagination isn't very efficient(does it leave the hidden rows in the dom?)
Not all of the gridviews have a lot of data. For example. The first tab have 3000 rows, with 100 rows/page. The second tab have 20 rows. When i select the second tab, until it unhide the first tab and show the second take 10+ seconds. I'm using normal gridview from c#.
Right, but that's still 3000 records that it has to hide before it can show 20. I'm not familiar with the c# gridview, do you know of an example page that i can view that demonstrates how it handles pagination? ( i don't need to see how it's slow with jQuery UI Tabs )
I found a simple sample on web that shows how does a c# gridview works. There is no tabs on this sample page, cause wasn't me that created it, it is just to show you the gridview. I can upload any grid if you want.
so between 7 gridviews, you have 517 rows. Gridview 2 only has 21(including header) and the rest contain roughly 70 rows each, correct? It doesn't sound quite right.... paginating with 70 rows per page?
I want to know how many <tr> elements are in the tab. If it's more than 102 for each page 1 6 and 8, then the grid view's paging system is simply hiding rows rather than removing/detaching them, which could definitely cause the slowdown you are getting.
If the numbers above ARE the number of tr's that exist within each tab, then that's why it's running slow. the browser has to go through 18666+ elements (plus td's, etc) and determine which ones need to be rendered.
I think the gridview IS paginating correctly, and 100 is just too many to page on. To test this, drop the rows per page down to 20 and see if it is any better.