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
225
sum cell from band[1] into cell in band[0]
posted

I have a ultrawingrid with two bands (0,1) and i want to sum the "amount" cell from band 1 into the "total" cell in band 0, Its posible to that with UltraCalcManager?

 

Thanks in advance,

Alejandro Castrejon

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Alejandro,

    Yes, you just use the name of the child band to reference the child column.

    So if I have have a grid with a Root band ("Band 0") and a Child Band ("Band 1") and Band 1 contains an integer column called "Column 1", I would do something like this:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band0 = layout.Bands[0];
                UltraGridColumn totalColumn;
                if (band0.Columns.Exists("Total"))
                    totalColumn = band0.Columns["Total"];
                else
                {
                    totalColumn = band0.Columns.Add("Total");
                    totalColumn.DataType = typeof(int);               
                    totalColumn.Formula = "Sum([Band 1/Column 0])";
                }
            }

Children