0

We are facing an issue, wherein we need to suspend grid painting for some time. We are using devexpress DXGrid bound to XPInstantFeedbacksource. We have a requirement of refreshing source every 2-3 seconds to get the updated realtime data which is huge (around 40 -50 thousand records in a day). However the refresh method of the above mentioned source binds the grid asynchronously and when it does so, it causes some kind of flickering onto grid. Internally it captures layout of grid before refresh and renders it back in postrefresh phase. I have tried many things like wrapping the refresh call in bigindataupdate and enddataupdate, but it doesn't seem to work. However, one thing which looks interesting to me is using Win32 api to suspend layout painting for some moments and resuming it. I found something at

How do I suspend painting for a control and its children?

which works well for Winforms, but in WPF as far as I know, individual controls share window handle. And method call

SendMessage(parent.Handle, WM_SETREDRAW, false, 0);

uses control handle to interact with WIN32. Also, I observed that if I suspend layout for window underlying grid still gets painted which is strange to me. I just want to know , if I am going in right direction by suspending grid layout to avoid flickering and if yes please suggest some way to achieve this.

Thanks,

Gurpreet

Community
  • 1
  • 1
  • `suspend grid painting for some time` - There's no such thing in WPF. forget that. You need to find a true solution. BTW if your data changes, raise `CollectionChanged` event or `INotifyPropertyChanged` as we all do instead of refreshing the entire `ItemsSource`. Post your current code and XAML and a screenshot of the problem. – Federico Berasategui Feb 04 '14 at 19:29
  • Let me explain a bit more. – user3271837 Feb 04 '14 at 19:54
  • Let me explain a bit more. First thing is Im am working in server mode. The underlying datasource (XPInstantFeedbacksource) is not a collection but a custom control. We keep dumping our records in SQLite Db and this datasource fecthes the data from that db every 2-3 seconds. By the way frequency of updates doesn't matter here. Even if I refresh it after 3 min, 5 min, result is same. So, bottom line is if I need to call refresh method of this datasource to make it connect to db and fetch the updated data, and that's when problem of flickering arises. and it happens when we group column in grid. – user3271837 Feb 04 '14 at 20:04

0 Answers0