Hello,
If I want to add the formula Dynamically without using the Formula builder it does not calculate the Formula. I am using the latest version of the product, that is 8.3. I wonder if there is a hotfix or I am doing anything wrong.
Here is what I am doing:
I added a WinGrid on a form then added these codes:
//To fiil the first column when loaded
private void Form1_Load(object sender, EventArgs e) { DataTable table = new DataTable(); table.Columns.Add("Age", typeof(int)); this.ultraGrid1.DataSource = table; DataRow row = table.NewRow(); row["Age"] = 12; table.Rows.Add(row); row = table.NewRow(); row["Age"] = 13; table.Rows.Add(row); row = table.NewRow(); row["Age"] = 14; table.Rows.Add(row); row = table.NewRow(); row["Age"] = 15; table.Rows.Add(row);
//add a caculated UnBound column
UltraGridColumn newColumn = this.ultraGrid1.DisplayLayout.Bands[0].Columns.Add( "Age2"); newColumn.Formula = "[Age]*2";
}
It adds the column but without any data.
In order for formulas to be processed, you must add an UltraCalcManager component to the form. If you create the UltraCalcManager at run-time, then you will need to link the grid up to it by setting grid.CalcManager ot the UltraCalcManager component.
Thanks!
We had this problem in prevoious version and we were told that we needed the hotfix!