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
60
Saving/Restoring the Widths of Columns
posted

Hi,

I'm looking for a way to save and restore the width of columns.  Some of the users of my software may want to manually size some columns and when they next visit the same page, they expect the columns widths to be the same as they were last time.  How would I do this?

BTW, I'm using the ASP.NET MVC wrappers.

Thanks,

Al

Parents
No Data
Reply
  • 24671
    posted

    Hi,

    there is no out of the box way to achieve this. I am not sure how your application is structured, and how you submit data to the server (whether it's based on AJAX requests or you do a full page submit) - but one possible way could be to retrieve the current column width after resizing, and then serialize some custom JSON and send it to the server , then de-serialize it and apply it to the grid on the next page load. 

    $("#grid1).igGrid("option", "columns")[<column index>].width

    that's how you can retrieve the current column width, at runtime. On resizing, the column object's width property gets changed accordingly.

    You can also contact Development Support if you need more in-depth help with this scenario. 

    Thanks,

    Angel 

Children