We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How can I improve the MVC Grids performance

Thread ID:

Created:

Updated:

Platform:

Replies:

103433 May 2,2012 08:17 PM May 9,2012 02:29 AM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Gary Cryer
Asked On May 2, 2012 08:17 PM

I have a data grid that can have up to 100 columns and almost as many rows. The performance of the grid slows down drastically in a 50x50 grid. Once the data is loaded there will be no more calls to the database. All the problems comes from client side events like scrolling and mouse over event.

Is there any performance tips that can be offered that could help. I have tried remove the OnRecordHover event with the following script:

gridObj.remove_OnRowHover(OnRecordHover);

but I get a null property exception on the remove_OnRowHover method.

regards,
Gary


Bala Murugan A.S [Syncfusion]
Replied On May 9, 2012 02:29 AM

Hi Gary,

Thanks for using Syncfusion Products.

Yes, It is possible to improve grid performance by disabling row hover and selection.

We suggest you to set EnableRowHover property of grid as false and remove the OnRowHover handler in script. Please refer the below code snippet.

[Grid]

@(Html.Grid<EditableOrder>("Grid1")

     ---

    .EnableRowHover(false)

    ---

    )

 

[JavaScript]

<script type="text/javascript">

        Sys.Application.add_load(function () {

            var gridObj = $find('Grid1');

            var handler = gridObj._selectionManager.get_events()._getEvent("OnRowHover")[0];

            gridObj._selectionManager.get_events().removeHandler("OnRowHover", handler);

        });

    </script>

We have an option to disable seletion and hover by using EnableRowHover and AllowSelection properties of grid. Please refer the below code snippet.

[Grid]

@(Html.Grid<EditableOrder>("Grid1")

     -----

    .EnableRowHover(false)

    .AllowSelection(false)

     ----

    )

Please try the above code and let us know if you have any concerns.

Regards,

Bala Murugan A.S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;