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
410
aligning child band column against matching parent band column
posted

I have a multi band grid where a child band has only a subset of the parent band's columns.

What I'd like to do is to have a child band's columns appear under matching parent band's columns.

I'd like to know what the best approach might be in accomplishing this.

My initial thinking is that I'd create kind of dummy columns for the missing columns in the child band then use DrawFilter to NOT draw those columns.  I guess then the question might be whether I create the dummy columns by creating those columns manually or create them by creating dummy properties on the business object itself.

Is there an easier way to accomplish this behavior?

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    I don't know of any other way to do this besides adding extra columns. I'd add the columns to the grid, rather than to do the data source, since they have no meaning in the data source, itself.

    Using a DrawFilter for this will be a bit tricky. You can actually get most of the way to where you need by simply using the InitializeRow event and setting the Hidden property on the cells of the "fake" columns. That will prevent the cells from drawing without having to use a DrawFilter.

    The problem is that you will still see the row background (which may not be a problem) and borders. There's really no way to DrawFilter those out, since the entire border of the row is drawn in one operation. You would have to draw over the borders in those place where you want to erase them.

    Or... maybe you could just set BorderStyleRow to None. That might work, since the cells will draw borders, anyway.

    So the only thing you would need a DrawFilter for in that case would be to prevent the drawing of the headers. But... if you use RowLayouts, you could set the LabelPosition on the fake columns to None and that might work.

Reply Children