Hi, I am looking for sample code that create a summary row of an UltraGrid. I am learning C#, please help.
Thanks,
Hi Mike,
Thanks for your help, code works very well with my project.
If I use ICustomSummaryCalculator, how i can adding an UltraCalcManager, I tried many way to add....but no way to add.
Hi,
I can't make heads or tails of that screen shot. But it sounds like you want a summary whose value is calculated based on two other summaries. Is that right?
If so, there are several ways to achieve that. The simplest way is to use an "external" summary. This is a relative new feature, though, so if you are using an older version of the grid, you might not have it.
Something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; band.Summaries.Add("Sum 1", SummaryType.Sum, band.Columns["Int32 1"]); band.Summaries.Add("Sum 2", SummaryType.Sum, band.Columns["Int32 2"]); band.Summaries.Add("Combined Sum", SummaryType.External, band.Columns["string 1"]); } void ultraGrid1_ExternalSummaryValueRequested(object sender, ExternalSummaryValueEventArgs e) { if (e.SummaryValue.Key == "Combined Sum") { RowsCollection rows = e.SummaryValue.ParentRows; int sum1 = (int)((decimal)(rows.SummaryValues["Sum 1"].Value)); int sum2 = (int)((decimal)rows.SummaryValues["Sum 2"].Value); e.SummaryValue.SetExternalSummaryValue(sum1 + sum2); } }
If you have an older version before External Summaries were added, the you would have to use either an ICustomSummaryCalculator or else a formula (which would mean adding an UltraCalcManager to the form).
I have a project with using UltraWinGrid.
I want to add 1 Summary of a Column by dividing 2 available Summaries of 2 different columns in UltraWinGrid.
Can you help me.
Thank you.
Hello,
i am vb.net developer A possible approach to achieve this might be by using the following code:
Dim summary As SummarySettings = _ Me.UltraGrid1.DisplayLayout.Bands(0).Summaries.Add("count", _ SummaryType.Count, _ Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0), _ SummaryPosition.UseSummaryPositionColumn)
' Set the tooltip on the summary settings object. This tool tip will ' be displayed on every summary value instance associated with this ' summary settings object. summary.ToolTipText = String.Format("Count of column {0}.", summary.SourceColumn.Header.Caption)
' Tooltip can be set on individual summary value objects as well, in case you ' want to display a different tool tip based on the calculated value. A good place ' to set such summary value specific tool tips is in SummaryValueChanged event. Me.UltraGrid1.Rows.SummaryValues("count").ToolTipText = _ String.Format("Count of column {0}.", summary.SourceColumn.Header.Caption)
if u need more help please contact me at below link
http://ahmadkhalid44.blogspot.com/
REGARDS:
Ahmad Khalid
Software Engineer
Saood Software Soluation
How do I check if the average, max, count, summary functions are turned on through the AllowRowSummaries features?
Joe