FlexGrid - Freeze the First X Left Columns

Posted by: mwebster on 18 March 2021, 8:49 am EST

    • Post Options:
    • Link

    Posted 18 March 2021, 8:49 am EST

    I was looking at this example (VB.NET/WinForms)

    https://www.grapecity.com/forums/winforms-edition/freeze-columns-in-flex-gri

    it shows how to freeze X number of right columns. I was wondering how to do the same with the X number of left columns. It wasn’t clear from looking at the example. Basically, I want to do the same thing except that instead of freezing the right columns in place, I want to freeze the left x number of columns.

    Thanks,

    Mike

  • Posted 19 March 2021, 3:03 am EST

    Hi,

    You can freeze the first X columns of the FlexGrid by using the Frozen property of the ColumnCollection cols of the FlexGrid.

    grid.Cols.Frozen = 5;
    

    You can also refer to https://www.grapecity.com/componentone/docs/win/online-flexgrid/freezingrowsandcolum.html, which shows how you can use the mouse to freeze columns.

    Regards.

    Avnish

  • Posted 19 March 2021, 7:31 am EST

    Fantastic! Thank-you very much for your help.

    Mike

  • Posted 19 March 2021, 8:42 am EST

    One more quick question…is there a way to “pre-freeze” certain columns at design time so that the user does not have to manually freeze the column(s) his or herself?

  • Posted 19 March 2021, 9:11 am EST

    Ok slight problem here - it doesn’t work. I tried setting the Allow Freezing property in the designer as well as in code and at no time to I ever get that option to actually freeze a column when the application is running. Filtering, sorting, resizing, etc all work but not Freezing. Am I missing something here?

  • Posted 19 March 2021, 9:17 am EST

    Sorry - managed to get it to work - mouse was just a little fiddly. If there was a way to freeze certain columns in code, that would be very helpful.

  • Posted 22 March 2021, 12:58 am EST - Updated 3 October 2022, 11:20 pm EST

    Hi,

    Please note you can not freeze arbitrary columns in FlexGrid but as we mentioned before, you can freeze the first X columns of the FlexGrid in code by using the Frozen property of the ColumnCollection cols of the FlexGrid.

    grid.Cols.Frozen = 5
    

    Please refer to the sample and GIF attached showing the same.

    Regards.

    Avnish

    FlexGridFrozen.zip

  • Posted 22 March 2021, 6:38 am EST

    That’s what I needed. Thanks for your help.

    Mike

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels