Home Forums WPF controls Xceed DataGrid for WPF Disappointing performance with 10 columns, 36 rows?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #26223 |

    I’ve just started working with this product, so maybe I’m doing something wrong, but I notice that if I bind a DataGridControl to a DataGridCollectionViewSource (which holds a DataView with 10 columns and 36 rows), performance is pretty disappointing. Specifically, as I move the cursor up and down without clicking, the “hover” selection bar is always several rows behind the cursor. Then, if I actually click, it takes maybe half a second for the row to fully select. Is this normal for such a small grid?

    (Note: I’m running this on a machine with a 2.16-Mhz DuoCore, 1 Gb RAM, and Windows XP SP2)

    While I’m posting, I thought I’d mention a couple other things:

    1. There doesn’t seem to be a straightforward way to turn on cell selection (rather than row selection). If I were creating, say, a color palette, how would the user select a particular color chip? How could I detect this event? It seems to me the regular ol’ Windows Forms DataGrid used to support cell selection. Adobe Flex certainly does.

    2. I see a method to AutoFit the width of a column to its contents but no property to do this automatically. I could be missing something, but having to write code to manually AutoFit the columns whenever the underlying data changes sort of defeats the purpose of binding. I also don’t think I came across a way to prevent users from resizing columns.

    3. Just my opinion, but I don’t think the “drag to group” header region should be on by default, and a simple property should be available to turn this on/off.

    Some of my issues may be just weaknesses with WPF in general, and some is me not having a very deep understanding the product yet. But I wanted to throw my issues out there now so I don’t pull my hair out trying to do things that aren’t practical to do with this product.

    Thanks for any feedback you may have,


    Imported from legacy forums. Posted by Daniel (had 4683 views)

    Xceed Support
    Post count: 5658

    Hi Dan,

    The performance issue you are reporting is quite abnormal compared to our own tests on the product. If you can provide more information on the exact setup of the application and of the DataGridControl, we can try to work things through to determine the nature of the issue.

    1. Excel-like Cell selection is not part of the current feature set of the DataGrid for WPF, but is on our todo list of features yet to be implemented. We have no timeframe on this feature at the moment.

    2. This one was a bugger for us from the start as well. Due to UI virtualization, it was not possible for us to determine a data source wide auto fit size. Therefore we decided not to include automatic AutoFit as this would result in columns constantly changing sizes as scrolling goes. We did not gave up on the topic, but we want to take our time to design a solid solution.

    3. Determining the default configuration of the DataGridControl is an exercise where we have to try to please the largest proportion of our users. Unfortunately, by its nature, this process is bound to be unfit for some of our clients. At the same time, when building our control’s design, we have to leave some doors opened for extensibility. For this reason, we chose a design where one have to modify the content Headers and Footers collection ( + their Fixed counterparts ) to modify their content, and stick as close as possible to WPF’s Content Model and Templating features.

    If you are interested, I already built a sample class, based on TableView that possess properties to turn On/Off the default Headers/Footers component. This class is far from perfect, but maybe it would fit in your intended usage (main limitation is that it limits the possibility to use custom Headers/Footers, but can be extended to better fit your needs ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 415 views)

    Odi [Xceed]
    Post count: 426


    I’ll add something here. When you try our XBAP Live Explorer demo (<a href=”http://xceed.com/Grid_WPF_Demo.html”>here</a&gt;), are the speeds excellent? Say, in the first demo, the “Solid Foundation” tab in “Look and feel”.

    Just wondering if at least the reference samples work well on your system.


    Imported from legacy forums. Posted by Odi [Xceed] (had 525 views)

    User (Old forums)
    Post count: 23064

    I’m also having the same problem with 100 rows, 10 columns. The rendering of the data rows using the WPF DataGrid is painfully slow.

    Imported from legacy forums. Posted by Paul (had 573 views)

    User (Old forums)
    Post count: 23064

    Well, I tried out your demo. It flies! No lag at all. So, I tried out another test with my data, this time on a completely blank window. Perfect! Again, no lag. Then I went back to my original example and started commenting features out, one by one. I finally landed on the cause: a BitmapEffect applied to a DockPanel.

    Here’s the XAML (sorry for the–lack of–formatting):

    Title=”Test Window” Height=”600″ Width=”800″>
    Source=”{Binding Source={x:Static local:ModelAccessor.Model}, Path=ViewSource[MyDataSource]}”/>
    <DockPanel Margin=”10″>
    <DropShadowBitmapEffect Color=”Black” Direction=”315″ ShadowDepth=”3″ />
    <Label DockPanel.Dock=”Top”>My Test Grid</Label>
    ItemsSource=”{Binding Source={StaticResource _myDataView}}”
    Margin=”10″ />

    If you comment out the bitmap effect, everything is great. If you leave it uncommented, the DataGrid is completely lagged. This seems like a bug. I would expect an initial hit of a bitmap effect when the screen first renders, but not continuously. Note that I’m using .NET FW 3.0. Perhaps this doesn’t happen with 3.5.

    Hope this helps. Thanks for your detailed answers to my questions.


    Imported from legacy forums. Posted by Daniel (had 558 views)

    User (Old forums)
    Post count: 23064

    Okay, a little further investigating and I figured out the problem: applying a bitmap effect to a container (like a DockPanel), causes that effect to propogate down the tree to all child elements. This understandably has huge performance implications.

    If I do the following, the problem goes away:

    1. Create a Grid
    2. Place a Border in the Grid.
    3. Place the DockPanel in the Grid.
    4. Note that there is only one cell and the Border and DockPanel share the same cell (but there is no nesting between the Border and DockPanel–neither is inside the other).
    5. Remove the bitmap effect form the DockPanel (which has several child elements) and put it on the Border (which has no child elements) instead.

    The result? Performance is back up to full speed.


    Imported from legacy forums. Posted by Daniel (had 457 views)

    Odi [Xceed]
    Post count: 426

    Good job figuring that out!

    Side notes:

    – Microsoft demoed .NET 3.5 SP1 at Mix08 and one of the new things was hardware accelerated effects, I’m not sure this replaces BitmapEffects but it seems promissing.

    – Currently, .NET 3.0/3.5 BitmapEffects can’t be used in XBAPs, word of warning

    – I expect as part of the roadmap we’ll be publishing soon, you’ll see Xceed will continue to dedicate a lot of work on improving performance again. I say again, because last year around this time we were doing the same thing, and got some great results. Though this time around, we’ll also add “perceived performance” and “data virtualization” to the items to work on.

    – .NET 3.5 SP1 itself might provide certain new APIs/objects that will help Xceed improve the DataGrid’s performance. We’ll be looking into that too.

    Thanks for posting your results.

    Imported from legacy forums. Posted by Odi [Xceed] (had 5629 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.