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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Columns order still persists after deleting localStorage

Thread ID:





145969 Jul 16,2019 09:29 AM UTC Jul 17,2019 06:39 AM UTC ASP.NET MVC - EJ 2 1
Tags: Grid
Catalin Radoi
Asked On July 16, 2019 09:29 AM UTC


I have a grid with both .EnablePersistence() and .AllowReordering().

At some point, based on a condition in a js, I am deleting everything from localstorage, but the MVC grid still persists the columns ordering :(

Here's the JS

                var arr = []; // Array to hold the keys
                var i;

                for (i = 0; i < localStorage.length; i++) {
                    if (localStorage.key(i).substring(0, 3) === "$ej") {

                for (i = 0; i < arr.length; i++) {

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On July 17, 2019 06:39 AM UTC

Hi Catalin,  

Thanks for contacting Syncfusion Support. 

We could see you would like to prevent the columns from persisting in the Grid. To avoid the persistence for the Grid columns, override the addOnPersist method of the Grid and remove the columns from the key list given for persistence. In the following code example, we have overrode the addOnPersist method within the DataBound event of the Grid. 

    function onBound(args) { 
        var cloned = this.addOnPersist; 
        this.addOnPersist = function (key) { 
            key = key.filter(item => item !== "columns") 
            return cloned.call(this, key); 

Seeni Sakthi Kumar S. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon