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
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])"; } }
Thanks Mike it's works fine.
Also I use this grid with data-entry behavior preset so when I add a new row in the parent band i wold like to expand the child band and focus the first cell to type new data.
I think i should use the AfterRowUpdate Event, Can you help me?
Thank's in advance
I'm not sure if that will be an easy thing to do. AfterRowUpdate makes sense and you could check if the row being update IsAddRow, so you will be able to tell if it's a new row being added or an existing row being updated.
But from a UI perspective, putting focus on the child row doesn't seem like a good idea. What if the user adds a new row and then enters some values into it and then clicks on some other control on the form or some other row in the grid? Do you really want to force focus back into the child row cell in that case?
Hi Mike,
I try with
e.Row.ExpandAll();
In the AfterRowInsert Event and work`s fine, whe I press the Tab key in the last cell of the Parent Band got the focus in the new row of the chid band.
Thanks for your time,