This is a migrated thread and some comments may be shown as answers.

problem with update on GridViewSummaryItem

4 Answers 127 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John Even
Top achievements
Rank 1
John Even asked on 22 Dec 2010, 09:55 AM
I use RadControls for WinForms Q1 2009 SP1.
The problem is that the aggregates are only updated when new items are added to my bindinglist, not when a property is just updated. I have tried different events, but no luck.

RadGridView1.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
RadGridView1.DataSource = myBindingList; // a BindingList<T> where T have INotifyPropertyChanged implemented
            

GridViewSummaryRowItem summaryRow = new GridViewSummaryRowItem();
summaryRow.Add(new GridViewSummaryItem("Fiskeslag", "SUM:", GridAggregateFunction.None));
summaryRow.Add(new GridViewSummaryItem("AntReg", "{0}", GridAggregateFunction.Sum));
summaryRow.Add(new GridViewSummaryItem("NettoVekt", "{0}", GridAggregateFunction.Sum));
summaryRow.Add(new GridViewSummaryItem("AntSlipp", "{0}", GridAggregateFunction.Sum));
RadGridView1.MasterGridViewTemplate.SummaryRowsBottom.Add(summaryRow);


When I change a property on my class (T) and call OnPropertyChanged the GridView is updated with the correct values, but the summaryrow is not. It is only updated when I do myBindingList.Add(T)

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 22 Dec 2010, 11:02 AM
Hello,

Unfortunatly, I don't have the older versions of the RadControls to be able to try this for you, but summary items are updated correctly in the current version. Are you able to upgrade to the latest version? There are many enhancements, new controls and fixes in the latest version and I'd reccommend updating.

Regards,
Richard
0
John Even
Top achievements
Rank 1
answered on 22 Dec 2010, 11:26 AM
I can't upgrade to the latest version right now, however I found a workaround:

myBindingList.RaiseListChangedEvents = true;
myBindingList.ListChanged += new ListChangedEventHandler(myBindingList_ListChanged);


void myBindingList_ListChanged(object sender, ListChangedEventArgs e)
        {
            if (e.ListChangedType == ListChangedType.ItemChanged)
            {               
                RadGridView1.MasterGridViewTemplate.Update(GridUINotifyAction.DataChanged);
            }
        }
0
Richard Slade
Top achievements
Rank 2
answered on 22 Dec 2010, 12:11 PM
Hi John,

Glad you found a solution. If there's anything else I can help with, just let me know
Richard
0
Alexander
Telerik team
answered on 27 Dec 2010, 04:16 PM
Hello John Even,

Thank you for contacting us. As Richard said this issue is addressed in our latest release. The best option when using your version is calling the Update method of the corresponding template. 

Do not hesitate to contact us again, if you have any further questions.

Kind regards,
Alexander
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
John Even
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
John Even
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or