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. Image for the cookie policy date
close icon

How can I improve the MVC Grids performance

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


1 Reply

BM Bala Murugan A.S Syncfusion Team May 9, 2012 06:29 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon