Home Forums WPF controls Xceed DataGrid for WPF Slow Performance

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26878 |

    I have an app with both a Web and a WPF front end.  They use exactly the same backend to get data from the database.

    The web side can render 1000 rows in a grid in about 4 seconds, while the xceed datagrid takes about 7 or 8 seconds to do 50!

     

    in both cases, i am binding an IList<Object> to the grids.  Is the amazing performance loss due to trying to bind to an IList? Is there a prefered object to bind to using the xceed grid?  Should i not be auto generating columns?  Any help in getting the render time up would be very much appreciated!

    Here is my code:

    <Page x:Class=”Page1″
        xmlns:xceed=”clr-namespace:Xceed.Wpf.DataGrid;assembly=Xceed.Wpf.DataGrid”
        xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
        xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
        Title=”Page1″>
       
        <StackPanel>
            <Label>Page 1</Label>
            <Label>
                <Hyperlink NavigateUri=”Page2.xaml”>Go To Page2</Hyperlink>
            </Label>
            <xceed:DataGridControl Name=”MyGrid”></xceed:DataGridControl>       
        </StackPanel>
    </Page>

    public Page1()
    {
         InitializeComponent();

         data =presenter.GetData(50);
         MyGrid.ItemsSource = data;
    }

    Thanks!
    ralph

    Imported from legacy forums. Posted by Ralph (had 1197 views)

    Xceed Support
    Member
    Post count: 5658

    Do you have a large number of columns?

    Currently the DataGridControl will create and display cells for all columns in the grid.

    For large number of columns, this process gets intense as the framework have to generate, measure and arrange large amounts of elements.

    We are currently evaluating methods to limit the amount of cells generated at any given time only to those currently visible. This feature is currently planned for version 2.1.

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

    User (Old forums)
    Member
    Post count: 23064

    10 columns – 2 DateTime – 2 String – 2 bool – 4 int

     

    is 10 a high number of colunms?

    Imported from legacy forums. Posted by Ralph (had 460 views)

    Odi [Xceed]
    Spectator
    Post count: 426

    Not really, but if half of those columns aren’t even in view, the column virtualization might still be an improvement.

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

    User (Old forums)
    Member
    Post count: 23064

    I too am getting some slow performance.

    I have 8 columns and 1 row 

    Imported from legacy forums. Posted by simon (had 579 views)

    Xceed Support
    Member
    Post count: 5658

    Hey Ralph,

       10 columns is definetelly not a problematic amount of columns ( I was thinking more in the range of 50-100 columns ).

       So after your reply, I took a deeper look at your Page XAML and noticed that you placed the DataGridControl inside a stack panel.

       The problem with this is that StackPanel will measure its children with no constraint, meaning that they will take as much space as they want.

       This causes the grid to stretch so that all its elements are visible, which explains the long loading time.

       I suggest placing the DataGridControl in a container that does not measure its children with no constraint, such as a DockPanel, to enable UI Virtualization:

        <DockPanel>
            <Label DockPanel.Dock=”Top”>Page 1</Label>
            <Label DockPanel.Dock=”Top”>
                <Hyperlink NavigateUri=”Page2.xaml”>Go To Page2</Hyperlink>
            </Label>
            <xceed:DataGridControl Name=”MyGrid”></xceed:DataGridControl>       
        </DockPanel>

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

    Xceed Support
    Member
    Post count: 5658

    [quote user=”simon”]

    I too am getting some slow performance.

    I have 8 columns and 1 row 

    [/quote]

    Can you elaborate on your problem? How is performance problematic with 1 row and 8 columns?

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

    User (Old forums)
    Member
    Post count: 23064

    heya Marcus,

    I tried that out, putting the grid in a dockpanel.  but im still getting pretty bad performance, still around 7 seconds for the 50 rows and 10 columns. Though now at least it scrolls correctly, thanks!

    I also tried Infragistics’s grid and I get about the same result.  Is this a problem with WPF in general?  I just cant believe a fat client app would be 40 times slower than a web app.

    Thanks again for the help,

    Ralph

    Imported from legacy forums. Posted by Ralph (had 635 views)

    User (Old forums)
    Member
    Post count: 23064

    just as some more info, my machine is a 2.4ghz Celeron with 1.5g memory and Intel integrated graphics.

    perhaps my machine is just too slow for wpf?

    Imported from legacy forums. Posted by Ralph (had 541 views)

    User (Old forums)
    Member
    Post count: 23064

    OK
    I have change my code to have 3 rows

    sorting a column takes approx 5 seconds.

    The strange thing is that I created a simple app to try and reproduce the problem and sorting appears much quicker.

    Not sure it it make a difference but i the objects i am binding to (in my real app) are generated by ideablade while the objects in my simple app are plain .net objects. So it could be a problem with ideablade.

    What code does the datagrid call on the items to compare them? 

    Imported from legacy forums. Posted by simon (had 2169 views)

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