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
785
Subtotals Rows with Merged Cells.
posted

So I have a grid and I have merged "rows" together via certain columns containing identical values.

".MergedCellStyle = MergedCellStyle.Always.MergedCellStyle = MergedCellStyle.Always"

So what I want to do would seem to be a common task but I'm not seeing an answer.  I want to create a "summary" for the "quantity" column of the rows that were merged together.   I don't want to group the rows like normal because I like the look of the "merged" cells for this particular grid.  AND I only want to display a total if more than one row is merged.

What am I missing?  I'm pretty good with using draw filters, but the only way I could see to use a draw filter would be if there was something that fired AFTER the last cell was merged but before the next row was created. 

I guess I could come up with a brute force way of doing this, but it just seems like it would be a common thing and I'm just missing something.

Parents
  • 469350
    Offline posted

    Hi,

    I'm not clear on exactly what you are trying to do.

    Where do you want to put the subtotal?

    I don't think that what you are trying to do here is very common at all, and the grid has no built-in subtotal functionality. So I don't think you are missing anything obvious here.

    If you wanted to place the subtotal inside the Merged cell, then that could be done with a DrawFilter or a CreationFilter. I'd probably go with the latter, myself. But there would be an issue of where to put the sub-total if it did not fit. For example, if there are only 2 cells merged, then the cell's value could be aligned to the top of the merged cell and the sub-total on the bottom, and that would work, but you would probably want some way to distinguish the sub-total via color or something.

    Another approach you could take would be to try using RowSpacingBefore and/or RowSpacingAfter properties to create a gap in between the rows where cells are merged.

     

Reply Children