Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Hiding Grid Columns

Last post 09-23-2008 7:55 by Bart. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-05-2008 8:16

    Hiding Grid Columns

    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,

    • Post Points: 20
  • 09-05-2008 9:02 In reply to

    Re: Hiding Grid Columns

    Answer

    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.

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-05-2008 9:30 In reply to

    Re: Hiding Grid Columns

    Yeah, I was hoping I didn't have to do that though.  It seems this should be included in a future release because it does keep track of the column ordering just fine.

     

    Thank you.

    • Post Points: 20
  • 09-05-2008 9:46 In reply to

    Re: Hiding Grid Columns

    Yes, it is a good point, we do think on making something publicly exposed for that. You can also review this forum thread for additional ideas for saving / loading grid state (although a little different from your scenario which includes tracking client-side changes to the server) - this may provide additional ideas:

    http://forums.infragistics.com/forums/p/9885/45543.aspx#45543

    I will do my best to have this idea (auto track client side changes) promoted for future releases.

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-05-2008 11:24 In reply to

    Re: Hiding Grid Columns

    Yes it would be very nice if that feature of being able to save/load the grid state was a part of the grid.

    • Post Points: 20
  • 09-08-2008 2:23 In reply to

    Re: Hiding Grid Columns

    Yep, I will try to escalated that. Just wanted to let you know, that we have a great customer feedback form, where you can suggest feature request (or even new products) directly to our Product Management team. The link is here:

    http://devcenter.infragistics.com/Protected/RequestFeature.aspx

    PM regularly scans all feature requests submitted via this form and chances are that this will be included at one point in subsequent releases. We take customer feedback very seriously, and from what I am seeing, most if not all of our TODO list is based on features requested by customer.

     

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-23-2008 5:38 In reply to

    • Bart
    • Not Ranked
    • Joined on 09-23-2008
    • Antwerp
    • Points 25

    Re: Hiding Grid Columns

    Hi,

    I have the same problem and can't fix this. First I hide a column on the client side:

    igtbl_getColumnById(ActiveColID).setHidden(true);

    then I hide the same column on the server side:

    UltraWebGrid1.Columns[ColumnID].Hidden= true;

    then I save the grid settings into the database.

    But after a postback. I got the same look as before I start hide the column. So the column I hide is back visible. How can I prvent this

    • Post Points: 20
  • 09-23-2008 5:47 In reply to

    Re: Hiding Grid Columns

    This could be a page lifecycle thing,  I guess it really depends on where you are using your code. Chances are that the grid is bound at a later point (after calling your UltraWebGrid1.Columns[ColumnID].Hidden= true; line). Databinding the grid essentially clears all columns and rows from the grid and all visual settings and starts from scratch.

    Is it possible to move the code to a place where you are sure happens after databinding? This could be the PreRenderComplete event for example.

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-23-2008 7:55 In reply to

    • Bart
    • Not Ranked
    • Joined on 09-23-2008
    • Antwerp
    • Points 25

    Re: Hiding Grid Columns

    I forgot to mention I was using the Callback Feature to get the column number on server-side.

     thx.

    • Post Points: 5
Page 1 of 1 (9 items)
Powered by Community Server (Commercial Edition), by Telligent Systems