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
385
Hiding Grid Columns
posted

I'd like to be able to hide grid columns and then save the settings to a user profile.  I can hide the columns on the client side just fine, but then on the next postback, the columns are back.  Is it possible to persist the visible/hidden columns?  I also would like this to be done without a postback.

 

Thanks,

Parents
  • 28464
    Verified Answer
    posted

    Hello,

    I think this is possible, however you will need to write some custom code for that. In the same javascript client side function that you use to hide the column of the grid just update a hidden field

    <asp:hiddenfield runat="server" ID="ColumnState" />

    document.getElementById("<%= ClientState.ClientID ").value += colIndex + ",";

    The on the server, you can parse the string (split by ",") and get the list of columns to be hidden from the server side as well.

    Hope this helps.

Reply Children
No Data