We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding to an ObservableCollection Supported??

Thread ID:





124588 Jun 15,2016 08:03 PM UTC Jun 17,2016 12:30 PM UTC WinForms 3
Tags: GridGroupingControl
Jeff Voigt
Asked On June 15, 2016 08:03 PM UTC

I was doing this in WPF but it doesn't seem to work in windows forms.  Is this supported for the latest version of Syncfusion / GridGroupingControl?  I'm setting my data source to an empty ObservableCollection<ViewRecord> that is later filled, but the UI does not refresh while items are added...


Amresh S [Syncfusion]
Replied On June 16, 2016 01:03 PM UTC

Hi Jeff, 

Thank you for using Syncfusion products. 

We had analyzed your reported query in our end and couldn’t be able to reproduce the issue. Here we have provided the simple sample. In the below sample, grid can be updated once the data is added to the observable collection.  
Please refer the below attached sample for assigning the observable collection values dynamically to the grid cells. If still the issue persists, please provide us with a minimal sample or the code snippet used for assigning the dynamically added items to the grid. 


Amresh S. 

Jeff Voigt
Replied On June 16, 2016 01:18 PM UTC

Not even close.

The example that you provided bindings the grid to an observable collection (yes).  Then when you click the add values button it created a new List<> and rebinds the data (not an observable collection).  This has nothing to do with my original question.  This is what I was trying to accomplish (that I was able to accomplish in WPF).

1) bind grid to an observable collection (could have 1 or 2 rows in it).
2) then click a button that adds a few rows to the observable collection (do not set a new datasource on the grid) and it should automatically update the grid.  That is how it works w/WPF because the grid knows to listen for changes in observable collections.

Look at your example and it does nothing of the sort.


Piruthiviraj Malaimelraj [Syncfusion]
Replied On June 17, 2016 12:30 PM UTC

Hi Jeff, 
Thank you for update. 
In order to update the grid with modified ObservableCollection<>  in runtime , TableDirty property of grid and Refresh() method can be used. Please make use of the below code, 
Code Snippet: 
//Add the record to ObservableCollection in RunTime. 
private void button1_Click(object sender, EventArgs e) 
   for (int k = 0; k <= 5; k++) 
      Random rand = new Random(); 
      int r = rand.Next(100); 
      source.Add(new SampleSrc(r.ToString(), "Category" + r.ToString(), "SampleData" + r.ToString())); 
   this.gridGroupingControl1.Table.TableDirty = true; 
Sample Link: 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon