Hello,
Can you explain the differences between the following Appearance properties? Reasons for using one over another?
1. summaryValue.SummarySettings.Appearance
2. summaryValue.Appearance
3. summaryValue.SummarySettings.GroupBySummaryValueAppearance
4. summaryValue.GroupBySummaryValueAppearance
Hi,
SummarySettings is the summary definition. It defines the summary for the entire band. So when you add a summary to the grid, you use grid.DisplayLayout.Bands[x].SummarySettings.Add and create the SummarySettings.
SummaryValue is a specific instance of a summary.
If you have a flat grid with no child rows and no grouping and you have summaries that appears at the bottom of the rows collection, then you will have only once instance of the SummarySettings, and one instance of the SummaryValue.
But there are several ways in which a single SummarySettings can appear in more than one place (in other words, have more than one instance). If you e OutlookGroupBy then each group will have it's own summary values. If you have a summary on a child band, then each set of child rows (under each parent) will have an instance (SummaryValue) of the summary. Also, you can use the SummaryDisplayAreas property to control where the summary appears and cause it to appear in multiple places (e.g. the top of the row and also the bottom of the rows).
In most cases, you will probably want to use SummarySettings.Appearance, since this will give the summary a consistent appearance. For example, if you have a summary in a child band, you probably want the summary under one child row to look the same as the summaries under every other child row. This will make it easy for the user to see that this is the same summary.
Alternately, you might want summary's appearance to be based on it's value. For example, in a financial application, you might want negative numbers to display in red and positive numbers in black. In this case, the SummarySettings.Appearance would not work, since it applies to all instances of that summary and the SummaryValue instances could have different values. In such a case, you would use the summaryValue.Appearance.
Item's 3 and 4 on your list are just the same objects but with appearances that only apply to the Summary when it shows up inside a GroupByRow. So these only apply when you are using OutlookGroupBy and are only needed if you want the summary inside the GroupByRow to look different than the summary outside the GroupByRow. Sometimes this makes sense if the Background or border colors of the GroupByRow clash with the normal summary colors that look okay outside the GroupByRow.
Thanks Mike for the explanation.
Side question on Group By rows and SummaryValues... I have a grid, first column "Acct/AuthSeq" is grouped, which is represented with a grey background. The rows with expander controls are group by (UltraGridGroupByRow) rows. The rows with all white background are the data rows (UltraGridRow).
I want to increase the height of the group by rows. To adjust the height of the UltraGridGroupByRow, I've tried ultraGridGroupByRow.Height = 30
Notice the height of the group by row did increase but in an undesirable way showing white spaces between the rows. I believe I need to change the height of the SummaryValues. Can you advise on how to accomplish this? Thanks.
I'm a little confused by the screen shots you posted here. That doesn't look like an UltraWinGrid.
But in any case, I tried creating a sample that does what you are doing and I see the same issue you describe. The Summary values do not fill the entire height of the GroupByRow. There's no property to change that behavior. The Summary value height is autosized to it's contents.
You might be able to make the summary values bigger using a CreationFilter, but I wouldn't recommend it. It would be very tricky, because you can have more than one summary for the same column, which means the summary values would have to divide up the space. Also, a summary value in a GroupByRow can appear below the summary description, which means that if it filled the entire height of the GroupByRow, it will cover up the description text. It would also be complicated because the SummaryValueIUElement is contained inside a fixed line UIElement so you would have to size both elements. So it seems like this just isn't feasible at this time.