Completed
Last Updated: 14 Mar 2016 08:00 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 15 Feb 2016 07:57
Category: GridView
Type: Bug Report
0
FIX. RadGridView - summary rows are not affected when the InvalidateRow method is called
To reproduce:

BindingList<Item> items = new BindingList<Item>();

public Form1()
{
    InitializeComponent();
    
    for (int i = 0; i < 5; i++)
    {
        items.Add(new Item(i,i * 1.25m));
    }
    this.radGridView1.DataSource = items;
    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

    GridViewSummaryItem summaryItem = new GridViewSummaryItem();
    summaryItem.Name = "Price";
    summaryItem.Aggregate = GridAggregateFunction.Sum;
    GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
    summaryRowItem.Add(summaryItem);
    this.radGridView1.SummaryRowsTop.Add(summaryRowItem);
    this.timer1.Start();
}

public class Item  
{
    private int id;
    private decimal price;

    public Item(int id, decimal price)
    {
        this.id = id;
        this.price = price;
    }

    public int Id
    {
        get
        {
            return this.id;
        }
        set
        {
            this.id = value;
        }
    }

    public decimal Price
    {
        get
        {
            return this.price;
        }
        set
        {
            this.price = value; 
        }
    }
}

private void timer1_Tick(object sender, EventArgs e)
{
    items[0].Price += 1;
    this.radGridView1.Rows[0].InvalidateRow();
    this.radGridView1.MasterView.SummaryRows[0].InvalidateRow(); 
}

Workaround: refresh the MasterTemplate or implement the INotifyPropertyChanged
0 comments