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
100
Fixed headers in infragistics grid
posted

Hi all,

I use successfully the option to fixe and unfixe the columns headers of a grid.

But i'm stuck with a little problem, and I can't find the answer to it.

If I have 5 columns (the first two fixed) in a grid like this                                 Column1 Column2 | Column3 Column4 Column5

and then try to fixed the Column4 it stays like this                                           Column1 Column2 Column4 | Column3 Column5

so far so good, but if I unfixe the Column4 it stays like this                               Column1 Column2 | Column4 Column3 Column5

Is there any way to put the Column4 back to it's original place?

Thank you

Hugo

Parents
No Data
Reply
  • 22852
    Verified Answer
    Offline posted

    Hugo,

    The grid doesn't track where the columns were before they were fixed because it is also possible that users could make other changes between when they are fixed and unfixed.  For example, if the user moves Column5 to be before Column3 between when Column4 is fixed and unfixed, how would the grid determine where to put Column4.  There are three possibilities in this case:

    • In between Column5 and Column3 so that the order would be Column5, Column4, Column3
    • After Column3 which results in the following order: Column5, Column3, Column4
    • Before Column5 which results in Column4, Column5, Column3

    These three possibilities are the result of moving just one column between fixing and unfixing a column and this can become much more complex as you add more columns where end users could make more modifications.  This is why when the column is fixed it is treated as if it was moved and when unfixed it will always become the left most column that can be scrolled.

    If you do have a set order of columns that you always know, you can use the Before/AfterColPosChanged events to set the order manually of the columns that are not pinned.  You can do this by setting the VisiblePosition of the Header of each column to be the position you need the columns to be in.

    Let me know if you have any questions with this matter.

Children