Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
990
Problem with grid and async WCF
posted

This is a weird one. I have an async WCF service I'm calling to load in data. The callback signals the UI (for update) and then calls itself again, until all items are loaded. A bit like this:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3849474&SiteID=1

Notice that all the dispatching to the main thread is of Background priority. When I run this (it loops about 1,000 times) the XamDataGrid becomes very unresponsive to mouse events (even mouse-over color changes). I can't scroll, select rows, or edit text

However it works perfectly with the keyboard!

What can the issue be?? Notice I'm not spawning loads of threads, all the calls are serialized. I've even added a Thread.Sleep(500) in the async callback to see if that makes a difference, but it doesn't.

Help!

Update: the grid remains unresponsive even after all the async comms has finished. Also, the other controls on the form (vanilla WPF + a XamDockPanel) behave perfectly throughout the loop.

Parents
No Data
Reply
  • 990
    posted

    This is deffinetly a grid bug. After playing with it some more I noticed that only some rows were 'locking', other were consistently fine. So I played with RecordContainerGenerationMode:

    Recycle - my original setting, exhibits the problems above

    PreLoad - SLOW! but doesn't exhibit this bug. Scroll bars behave strangely (the slider part magically changes from small, lots of items, to large, few items, without the number of items changing!)

    LazyLoad - doesn't exhibit the bug, slightly faster than preload, but still with the scroll bar weirdness

    Virtualize - doesn't exhibit the bug, or scroll bar problems, but does randomly crash while scrolling

    As a workaround I've switched deferred scrolling back on (I hate it) and gone with LazyLoad. The deferred scrolling fixes the scroll bar weirdness.

    This grid is SO FRUSTRATING!

    WPF 2008 vol 1, .NET 3.5 sp1

Children
No Data