Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Comparing column values ?
posted

I 've downloaded RowSummaryAverageWithNullcs sample project (article id : 10019)  from Infragistics website. I 've added a column in testdata function. 

dtData.Columns.Add("Column 2", typeof(int));

In initializelayout event,

if i use // formula 1 line  as : 

e.Layout.Bands[0].Summaries["Summary"].Formula = "sum(if(isblank( [Column 1]) , [Column 1] , [Column 2] ))";

it works fine. and displays sum. 

but if i use //formula 2 line  : 

e.Layout.Bands[0].Summaries["Summary"].Formula = "sum(if([Column 1] > [Column 2], [Column 1] , [Column 2] ))";

 

it says : value# incorrect type of argument or operand.

can 't i use column comparision in formula ?

        private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)

        {

            e.Layout.Bands[0].Summaries.Add("Summary", Infragistics.Win.UltraWinGrid.SummaryType.Formula, this.ultraGrid1.DisplayLayout.Bands[0].Columns["Column 1"], Infragistics.Win.UltraWinGrid.SummaryPosition.UseSummaryPositionColumn);

            //formula1 e.Layout.Bands[0].Summaries["Summary"].Formula = "sum(if(isblank( [Column 1]) , [Column 1] , [Column 2] ))";

            //formula2 e.Layout.Bands[0].Summaries["Summary"].Formula = "sum(if([Column 1] > [Column 2], [Column 1] , [Column 2] ))";

            e.Layout.Bands[0].Summaries["Summary"].DisplayFormat = "Sum= {0}";

        }

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    I'm not famililar with the sample you are referring to here. Can you post the link to where you got it?

    I don't see anything wrong with your formulas here - assuming that the column keys are actually "Column 1" and "Column 2".

    Wait, I take that back. The formula you have here actually does not make sense for a Summary. If you reference a Summary in a column, then you are referencing the entire column. Sothe IsBlank function has no meaning for a column reference, it only has meaning for a single value like a cell.

Reply Children