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
95
How to optimize WebGrid with large number of Columns ?
posted

I need to be able to display a large number (up to 300) columns in a WebGrid. There may be as many as 200 rows. I have quickly thrown together a test application that fills a DataTable with 300 column (all of type String) and 200 rows which I then bind to a WebGrid. I have not tweaked the WebGrid in any way from its defaults.

I am seeing very slow performance when moving around the grid. Moving from Cell to Cell is sluggish and when I change any Cell value there is a very long delay before getting control back to the end user.

Can you give me some tips on how to optimise the end user experience when using the WebGrid in this kind of scenario. I have tried setting EnableViewState to False which did not help that much. Is there some ReCalculation going on that I can turn off or can I stop some events firing maybe?

Parents
No Data
Reply
  • 50
    posted

    As part of the application I support, we had a simular request, 200+ columns and 400+ rows.  I found that columns affected performance much more than than did rows.  With a fully populated grid, moving from cell to cell would take 5 seconds or more.  This was totally unacceptable to our users, so I devised methods to group the columns of data and let the users decide on which type of data they wanted to see at one time.  I also devised methods to group the rows, so users could filter out rows of data that was not necessary at that moment. This improved performance to a level acceptable by the users.  Still not as fast as their client based version of the application, but that is the price we pay for browser based applications.

    As WombatEd and Vince mentions, most of the performance issue is due to the huge number of objects (individual cells) created.  One way I found to improve performance was to eliminate highlights (row, cell, and column). If you highlight a row, it has to highlight every cell in the row, and that takes time.  Same with column selection.  If a user selects a column, I only highlight the header, and that improves performance some too.

    I have been working on this grid going on 2 full years now, finding small ways to improve performance, especially when they wish a new feature added which would slow down the whole process.


    Good Luck

     

Children
No Data