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.
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.
Thanks Mike!
Here is how I would describe what I'm trying to do. I have and order that I want to track multiple orders for a single Item. I "Merge" the columns that contain the "Item Name" and then each unmerged row has an Item Order Qty. So when the ItemID changes, I want to insert a subtotal row, for the rows that have the same ItemID.
Obviouly this would be easy if I "Grouped by" item id, but I already have a couple of group levels and it looks better with the merged. I don't "think" there is a way to "group" without having a group by row?
Yeah I see how to do this with a draw filter. But I will have to detect the ItemID change, and then move back a row and do the rowspacing thing. I was just "hoping" that there was something that would do this for me without having to go down that route.
Thanks,
Dan