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
9364
AllowColMoving
posted

We have grids which shows like this

 A    B  C       D1   D2    D3 ...    D99  D100

where D1, D2 .... D100 are date columns and A, B, C are some other fields on that record

Requirement:

        1.  User should be able to reorder fields A, B, C anywhere to the left of D1

         2. User should NOT be able to change order of D1, D2, ... D100 at all. The reason is obvious. We do not want to column for April 10 (D5) to show before April 9 (D4)

For requirement 2, I would like to set AllowColMoving to NotAllowed only for D columns to keep them frozen in place. From what I  am reading and experiencing, UltraGrid set it for the whole grid or none. If that is indeed the case, what is my option to keep only D column  from being moved?

 

Thanks!

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    The reason AllowColMoving is not available on a per-column basis is that it doesn't really make sense because moving a column which is allowed to move could affect the position of the column that isn't.

    So, in this example, even if all of the D columns had AllowColMoving disabled, you could still place Column A in between columns D1 and D2, and thus change the position of column D1.

    So your best bet here is to use the BeforeColPosChanged event and examine the new column positions and set e.Cancel to true if the user does something you don't like. :)

Children