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
505
Child band not move with Parent when switching column
posted

Hi

I have implemented multiple bands in the grid. The grid only shows the top parent header columns by setting

Bands[0].Override.HeaderAppearace.HeaderPlacement = OncePerRowIsland.  When I moved around header column in the grid.  The child bands do not move along with the parent. 

How do I get the child bands moving along to sync with the parent when the parent columns being move around?

 

  • 505
    posted in reply to Mike Saltzman

    Thank you, Mike and Steve Osterberg.

    After having read your reply, I searched the forums again and found the below post (Steve Osterberg replied on 08-07-2008 3:24 PM) to have the resolution including the code snippet I could use.  And best of all, the code worked as a jewel.

    http://forums.infragistics.com/forums/p/8847/44435.aspx#44435

    When copying the code the opening "[" in the method signature was not copied, it should read as

    private void SynchronizeColumns( Infragistics.Win.UltraWinGrid.ColumnHeader[] columHeaders, PosChanged posChanged )

    And I replaced the hardcoded "this.ultraGrid1" by declaring an object "grid = sender as UltraGrid".

  • 469350
    Offline posted

    The grid won't do this for you automatically. What you probably need to do is handle the AfterColPosChanged event and you can loop through the child bands and update the VisiblePosition of each column to match up with the position of the corresponding column in the root band.

    The tricky part of this is that setting the VisiblePosition on the column might cause AfterColPosChanged to fire again. If that's the case, then you can probably just handle it by bailing out of the event handles when the column's band is not the root band. Or, you could avoid this recursion by using the grid's EventManager to disable the event while you are in it.