Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
WebTab - WebGrid Performance
posted

Hello to everyone,

I realize that this may seem like a post for the WebGrid forum, but I submitted one there a week ago (April 29, to be exact) and have gotten 0 replies.  So, since the methods that I'm about to ask about are "particularly useful if the grid is placed inside of a WebTab", then maybe someone from the WebTab group has some experience with them.

I have a web page with an UltraWebTab on it.  I have around 10 tabs, each with one or more UltraWebGrids on it.  Naturally, performance is a little slow, so I looked for ideas in the online documentation.  For the grids, I found the client-side methods "hide" and "show", and they look like they're designed to be used in a WebTab environment.  I have included their descriptions below.

hide - Hides the grid on the page. The method is particularly useful if the grid is placed inside of a WebTab. The method has to be called right before the tab with the grid on it is switched from. Also see the show() method.

show - Restores grid's visibility on the page after it has been hidden with the hide() method. Particularly useful when the grid is placed in a WebTab. This method has to be called right after the tab with the grid on it became visible.

I am hoping that someone can:

1. Give me a bit of a description of WHY I would call these methods.  My gut tells me that there would be some sort of performance improvement by calling these methods.

2. If it IS for performance reasons, then I would imagine that in order to get most of the performance improvement, I would also want to start off with all of the grids being hidden (except for the one on my first tab).  What is the proper way to do that?  (Note:  I have working code to hide the grids from the current tab in the BeforeSelectedTabChange event, and show the grids from the next tab in the AfterSelectedTabChange event, so I have no problems there.  I just need to figure out how to start with having the grids in a hidden state.  I have tried setting the grid's html "Visible" attribute to false, but then when I try to call the show method, it tells me that it can't find the grid.  I have also tried setting the grid's Visible property to false on the server-side, and subsequently can't find the grid in the client events either.)  Maybe there is another client-side event for the WebTab that I should be handling, and then just calling that same hide method for all of the grids?

 Thank you very much for your time,

 Jamie Foster

 P.S. In case it matters, I'm using 2007 Vol. 1, CLR 2.0

  • 28464
    posted

    Hello,

    I took the time to play with the show() and hide() UltraWebGrid CSOM methods. Indeed, the documentation is far from complete regarding these metohds and I could not find any additional information in the samples,  so I tried directly playing with them and looked at their source. As far as I can tell, both methods deal only with adjusting grid placeholder size and do not deal with fetching data dynamically in any way, so I do not think they are related to the actual HTML size fetched by grids inside Tabs.

    I believe the way to go here is AJAX. You can place the whole Tab instance (with grids inside) inside an UpdatePanel and trap the postback TabClick event handler (which would be automatically "ajaxified" by UpdatePanel) and make all grids in all tabs invisible (set grid.Visible = False) with the exception of the grid in the currently selected tab. This will ensure that only the currently selected grid's HTML will be sent from server to client.

    Hope this helps.