Hi
I'd like to learn the basics of how to create and use summaries in UltraGrid in code.
I've looked in the documentation but it only focuses on special use cases.
Where is the best place to find a basic guide?
Thanks
Hello Craig,
Thank you for contacting Infragistics Developer Support!
Summaries can be enabled at the band of column level, you can see the following on the AllowRowSummaries properties on those at the following links:
www.infragistics.com/.../infragistics.win.ultrawingrid~infragistics.win.ultrawingrid.ultragridoverride~allowrowsummaries
www.infragistics.com/.../infragistics.win.ultrawingrid~infragistics.win.ultrawingrid.ultragridcolumn~allowrowsummaries
www.infragistics.com/.../infragistics.win.ultrawingrid~infragistics.win.ultrawingrid.allowrowsummaries
Do you have any specific questions about summaries?
Hi Michael,
Thanks for the reply.
It's not quite what I was hoping for. I want to create and format a summary in code but it is difficult to determine what I create and set and in what order.
A high-level programming guide /overview would be very helpful to start with than I'd feel more comfortable looking ad the API documentation.
Thank you for the update. When are you calling those methods? How are you setting up the grid? Do you have a sample you can attach that I can run/debug to see why the caption isn’t being displayed for you?
Update: I've used this code with other grids and the caption is displayed. Puzzled why the override would not be set in this case.
Thanks for your help so far.
I have got a basic summary working now but I can't get the summary caption to display.
I set the override value in code but when I pause in debug it is set to Default. If I change it in the immediate windows to true it displays ok. Code below:
public static void AddSummaryValue(ref Ucl.Main.uclGrid ugdList, string colName, SummaryType summaryType, SummaryDisplayAreas summaryDisplayArea, Infragistics.Win.HAlign hAlign, int summaryBand) { SummarySettings sumSummary = ugdList.DisplayLayout.Bands[0].Summaries.Add(colName, summaryType, ugdList.DisplayLayout.Bands[0].Columns[colName]); sumSummary.SummaryDisplayArea = summaryDisplayArea; sumSummary.Appearance.TextHAlign = hAlign; ugdList.DisplayLayout.Bands[summaryBand].Summaries[colName].DisplayFormat = "{0:" + ugdList.DisplayLayout.Bands[0].Columns[colName].Format + "}"; } public static void SummaryFooterCaption(ref Ucl.Main.uclGrid ugdList, string caption, int summaryBand) { ugdList.DisplayLayout.Bands[summaryBand].SummaryFooterCaption = caption; ugdList.DisplayLayout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.True; ugdList.DisplayLayout.RefreshSummaries(); }
Thank you for the update. If you look at the API link and scroll down there is a code sample. In the code sample it demonstrate enabling summaries, how if you want disabling it for specific columns. Then it shows how to create a Max and Avg summaries, how to set the format for those summaries.