I have a summary row at the bottom of my wingrid, with some extra text the users have required to identify exactly what what being totaled and some totals within that total (I get these by running a Loop for each row).
Anyway, it works great, all my information comes through in the summary row correctly.
The problem I am having is the information is quite a bit wider than the column being totaled. I could widen this column to display the summary correctly, but it leaves the grid looking funny and forces a horizontal scroll bar.
Is there anyway I can widen just the Summary column, and not the entire grid column, or set the summary column to print out expanding over other columns summary fields (which are not being used)?
If not, is there another way I can get around this so that I can display the correct summary information.
Thank you for your help.
T.J.
Hi T.J.,
When you create the summary, you are probably setting it to align to the column it is summarizing. If that's the case, then the summary width will always be the width of the column.
One option would be to specify a location for the summary using an enum instead of a column. There are overloads of the Summaries.Add method that all you to specify that the summary is aligned Right, Left, or Center instead of linking it to the column. This way the summary will be 1/3 of the width of the band.
The other option would be to use a CreationFilter to change the rect's of the UIElements that make up the summary.
Thank you very much Mike, this got me exactly what I needed.
Now a follow up (there is always a follow up, ugh), what is the code to remove a summary on a Windows Grid. Here is the code I am using to add the summaries...
objSummary2 = grdEmployeeInfo.DisplayLayout.Bands(0).Summaries.Add("EmployeeSummary", SummaryPosition.Left, .DisplayLayout.Bands(0).Columns(1))
I would think it would be
.DisplayLayout.Bands(0).Summaries.Remove("EmployeeSummary")
But this is giving me an error.
Thank you for your help, and let me know if I am on the right path or not.