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

Real-time Data via ObservableCollection

2 Answers 305 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 05 Oct 2011, 04:41 AM
Hi,

I have a radgridview that is bound to an observablecollection containing 16 properties, one for each column of the radgridview.  I have an WCF service that I poll every second, updating the observablecollection and thus, updating the radgridview.  I'm doing this with a dispatchertimer that fires a backgroundworker.  This works quite smoothly, although larger result sets (more than 50 rows) cause the GUI to freeze and/or the radgridview to "blink" momentarily.  Those, I'm assuming are limitations of WPF's threading abilities.  Anyhow, the largest problem I have is that on radgridview's that scroll vertically, when a user scrolls down, the grid scrolls all the way back to the top whenever the collection changes.  

I'm using Row and Column virtualization, if that makes any difference.  

Is there a way to make the grid not scroll to the top when the collection changes??

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Oct 2011, 07:04 AM
Hi,

 This will happen only if you refresh the entire ItemsSource of the grid. If you refresh just items in the collection bound to RadGridView everything will work as expected. You can check for example this demo:
http://demos.telerik.com/silverlight/#GridView/RealTimeUpdate

The example is for Silverlight however the same approach can be used in WPF as well. You can check your local version of our WPF demos for more info. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Kurt
Top achievements
Rank 1
answered on 05 Oct 2011, 07:40 AM
Hi,

I actually used the demo you pointed out in the initial development of this, but ditched because I couldn't get it to work correctly.  It would only update 1 row at a time for me.

Is it safe to say that I have to use a queryablecollectionview for this scrolling behavior to go away?  Right now, I am just using an observable collection and clear it  prior to repopulating it (since I only want it to have 1 set of data within it).

Thanks in advance.
Tags
GridView
Asked by
Kurt
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Kurt
Top achievements
Rank 1
Share this question
or