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
740
Display Custom Summary Values
posted

Hi,

I want to display the following details in a Grid.

Col1           Col2               Col3            Col4           Col5            Col6

                                      $25.00          $20.00        $15.00         $10.00

                                      $50.00          $ 8.46         $ 7.00         $20.00

                                      $ 6.00          $ 5.00         $10.00         $ 9.00

--------------------------------------------------------------------------------------------------------

Sub Total:                    $ 81.00       $33.46        $32.00        $39.00

                                (e.g. 25 + 50 + 6)

===================================================== 

Total:                           $104.50        $33.50         $32.00        $39.00

                                (33.50 + 32 + 39) 

===================================================== 

The Sub Total equals to Sum of each column. For example: Sub total for Col3  = 25 + 50 + 6  = 81. Same applies for other columns

The Total  displays a diffrent story. it will be equal to Sum of Colums (excluding Col3) which are already summed and with some rounding up with a Col4

e.g. Total  =  RoundUp(Col4) + Col5 + Col6  = 104.50

 I have added the following coding for UltraGrid:

this.UltraGrid.CalcManager = this.ultraCalcManager1;

this.UltraGrid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;

this.UltraGrid.DisplayLayout.Override.SummaryDisplayArea = ((Infragistics.Win.UltraWinGrid.SummaryDisplayAreas)(((Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.BottomFixed | Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.InGroupByRows)

| Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.GroupByRowsFooter)));

this.UltraGrid.DisplayLayout.Override.SummaryFooterCaptionVisible = Infragistics.Win.DefaultableBoolean.False;

this.UltraGrid.Name = "UltraGrid1"; this.UltraGrid.Text = "ultraGrid1";

this.UltraGrid.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.UltraGrid_InitializeLayout);

 

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

{

if (e.Layout.Bands[0].Columns.Exists("Col3"))

{

ss = e.Layout.Bands[0].Summaries.Add(
SummaryType.Sum, e.Layout.Bands[0].Columns["Col3"], SummaryPosition.UseSummaryPositionColumn);

}

 

if (e.Layout.Bands[0].Columns.Exists("Col4"))

{

ss = e.Layout.Bands[0].Summaries.Add(
SummaryType.Sum, e.Layout.Bands[0].Columns["Col4"], SummaryPosition.UseSummaryPositionColumn);

}

 

 

if (e.Layout.Bands[0].Columns.Exists("Col5"))

{

ss = e.Layout.Bands[0].Summaries.Add(
SummaryType.Sum, e.Layout.Bands[0].Columns["Col5"], SummaryPosition.UseSummaryPositionColumn);

}

 

if (e.Layout.Bands[0].Columns.Exists("Col6"))

{

ss = e.Layout.Bands[0].Summaries.Add(
SummaryType.Sum, e.Layout.Bands[0].Columns["Col6"], SummaryPosition.UseSummaryPositionColumn);

}

}

Now here are my questions:

1. How can I display the "Sub Total" caption without the " Grand Summaries"

2. And to display the Sum for each column for Sub Total with the Format of $ 0.00 (currenctly it is 12.28193)

3. How to create a customized summary row with the Caption "Total" and to set a column (Probably under Col3 after SubTotal as show above)  the calcuation  = RoundUp(Col4) + Col5 + Col6  using a formula with ultraCalcManager1

I hope u cleary understand my points. PLease let me know if anyone need clarifications.

URGENT HELP NEEDED!!

Thanks in Adance!

nw

  • 469350
    Verified Answer
    Offline posted

    It's really hard to tell just from code snippets, but I will take a shot. 

    nomiw said:
    1. How can I display the "Sub Total" caption without the " Grand Summaries"

     

    I'm not sure if this is possible. There's a SummaryFootCaptionVisible property, but the property is on the Override and so affects the entire band, so I don't think you can remove one without removing the other. 

    nomiw said:
    2. And to display the Sum for each column for Sub Total with the Format of $ 0.00 (currenctly it is 12.28193)

    Use the DisplayFormat on the SummarySettings.

    nomiw said:
    3. How to create a customized summary row with the Caption "Total" and to set a column (Probably under Col3 after SubTotal as show above)  the calcuation  = RoundUp(Col4) + Col5 + Col6  using a formula with ultraCalcManager1

    I'm not sure I understand the question. You can't create an extra summary row. But maybe you can just as a new summary and use the DisplayFormat to have it show something like "Total = xxx"