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
930
Aligning the last columns of a multi band grid
posted

Hi,

As you can see from the attached image I have  a grid with multiple bands. What I would like to do is synchronise the last column of the parent and child band so that they are aligned.

Is this possible?

Thanks

Ryan

  • 469350
    Verified Answer
    Offline posted

    Hi Ryan,

    I'm not entirely sure I understand your question. The image you have here shows a grid with 2 bands. The parent band looks like it has 3 columns and the child band has 2.

    Now... by default, the column widths in each band of the grid are synchronized. So Columns 0 in each band will always have the same width (with a slight difference to account for the indentation). Your grid is not doing that, so you must have set AllowColSizing to Free so that the column widths in each band are independent.

    So it sounds like what you want to do is synchronize band 0, column 1, with band 1, column 0. That is, the first column in the child band lines up with the second column in the first band. And then the same for each column after that, ignoring the first column in the first band.

    There's no built-in way to that in the grid. But what you might try it using the AfterColPosChanged event. this event will tell you when a column is resized. So you could trap for when this happens and try to synchronize the column(s) in the other band.