Completed
Last Updated: 22 May 2014 11:40 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 20 May 2014 06:13
Category: GridView
Type: Bug Report
1
FIX. RadGridView - Incorrect calculated column's value containing another calculated column in its expression
To reproduce: add a RadGridView and bind it to the Northwind.Products data table. Use the following code:

private void Form1_Load(object sender, EventArgs e)
{
    this.productsTableAdapter.Fill(this.nwindDataSet.Products);

    RadMessageBox.Show(string.Format("TOTAL2 = {0}", NewExpression()));
}

public string NewExpression()
{
    this.radGridView1.Columns.Add(new GridViewDecimalColumn("TOTAL1") { Expression = "ReorderLevel + UnitsOnOrder" });
    this.radGridView1.Columns.Add(new GridViewDecimalColumn("TOTAL2") { Expression = "TOTAL1 + UnitPrice" });
    
    //uncomment to get the value of "TOTAL2"
    // var total1 = this.radGridView1.Rows[2].Cells["TOTAL1"].Value;

    var total2 = this.radGridView1.Rows[2].Cells["TOTAL2"].Value;

    return total2.ToString();
}

It  is not possible to access the column value ("TOTAL2") before firstly to access the column "TOTAL1" value.
0 comments