Completed
Last Updated: 21 Nov 2016 08:54 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 15 Sep 2016 05:59
Category: GridView
Type: Bug Report
1
FIX. RadGridView - calculated column's values containing aggregates are not recalculated when the grid is filtered and the aggregated value is recalculated
To reproduce:

1. Use the following code:
public Form1()
{
    InitializeComponent();

    this.radGridView1.EnableFiltering = true;

    GridViewDecimalColumn col = new GridViewDecimalColumn();
    col.Name = "Calculated Column";
    col.HeaderText = "Order value";
    radGridView1.Columns.Add(col);
    radGridView1.Columns["Calculated Column"].Expression = "Freight/Sum(Freight)";
}

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

    this.radGridView1.DataSource = this.ordersBindingSource;
    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    
    GridViewSummaryItem summaryItem = new GridViewSummaryItem();
    summaryItem.Name = "Freight";
    summaryItem.Aggregate = GridAggregateFunction.Sum ;
    GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
    summaryRowItem.Add(summaryItem);
    this.radGridView1.SummaryRowsTop.Add(summaryRowItem);
    this.radGridView1.SummaryRowsBottom.Add(summaryRowItem);
}

2. Filter the grid by EmployeeID for example. You will notice that the summary item for Freight is recalculated considering the filtered rows. However, the calculated column doesn't update its values.
0 comments