I want a simple totals row at the bottom of the grid. No "Sum =" in the cell, just the total of all the cells in that column. Hopefully the whole row would be in bold font.
I've got the summaries displaying the correct values, in the correct places, except there are two summary rows, one that contains the SummaryFooterCaption, and one that contains the summary values. Can I get the values on the same row as the caption?
If I could just get rid of the "Sum =", and move the values up a row, I'd be a happy camper (for now :).
Later
Art
Hello,
Thank you for question.
I have created new sample and it worked fine again. It has two columns, type of "int" and "double" and the following code in the InitalizeLayout event:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Allowing Summaries in the UltraGrid e.Layout.Bands[0].Columns["int1"].Formula = "if( [int]=0 , 0 , 100/[int] )"; e.Layout.Override.AllowRowSummaries = AllowRowSummaries.True; // Setting the Sum Summary for the desired column e.Layout.Bands[0].Summaries.Add("sumarryKey", SummaryType.Sum, e.Layout.Bands[0].Columns["int"]); //Set the display format to be just the number e.Layout.Bands[0].Summaries["sumarryKey"].DisplayFormat = "{0}"; //Hide the SummaryFooterCaption row e.Layout.Bands[0].Override.SummaryFooterCaptionVisible = Infragistics.Win.DefaultableBoolean.False;
Please feel free to let me know if I am missing something from your scenario.
I am following you example above and get this error. If I change Int to a valid column key in the grid I get a duplicate key error. What am I missing?
Key not found: 'Int' Parameter name: key
Hello Art,
I am just checking the progress of your issue.
If you need any additional assistance please do not hesitate to contact us.
Hello ArtWebb,
You probably could use a Formula like the following one:
"if( [Int]=0 , 0 , 100/[Int] )" , where the [Int] is the colum that might have 0 values, and if that's true, I am going to populate the desired cells with 0-s, if that's not the case, the Formula would be following one - 100/[Int]. Please feel free to let me know if this is what you are looking for.
Thanks - it's working almost perfectly now. This forum is great!
Last question - I have added a column that uses a formula based on other columns. Long story short - Can I change the "#DIV/0!" to something else, even "0", when I get a divide by zero error?
Thanks again.