Performance Question

6 posts, 0 answers
  1. Cuthahotha
    Cuthahotha avatar
    81 posts
    Member since:
    Sep 2008

    Posted 23 Jul 2010 Link to this post

    What am I doing wrong?

    I have a grid, as shown below in code.  The data source is set in code to a c# observable collection with 18 items in it.  It takes 9-10 seconds to load the grid.  Filter takes about 3 seconds and to unfilter takes about 8-9.  Details template is not used at this time, but will be in the future.

    The collection has 20 columns, most text and only 2 of them are bound at this point.  About 10 will be bound on the row. Longer text items will go in the details template in the future.

    All other operations on the same observable collection are split second in speed (loading in a tree view via recursive code, etc)

    <Grid x:Name="LayoutRoot" Background="White">
        <telerikGrid:RadGridView x:Name="grdMain" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
             Margin="1,0" MaxHeight="500"
                          RowIndicatorVisibility="Collapsed" IsReadOnly="False" AutoGenerateColumns="False" CanUserFreezeColumns="False" 
                          CanUserResizeColumns="True">
             
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewToggleRowDetailsColumn />
                <telerikGrid:GridViewDataColumn Header="Type"  DataMemberBinding="{Binding Type}" />
                <telerikGrid:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" />
             </telerikGrid:RadGridView.Columns>
        </telerikGrid:RadGridView>
    </Grid>
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 27 Jul 2010 Link to this post

    Hi Cuthahotha,

     I've just tried to replicate this however everything pretty fast for more. You can check the attached project for reference. 

    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Cuthahotha
    Cuthahotha avatar
    81 posts
    Member since:
    Sep 2008

    Posted 09 Aug 2010 Link to this post

    Vald,

    Thanks for trying.  The example app doesn't address several things.

    As mentioned in the original post the data is held in an observable collection, has lots of columns, and the columns have lots of text in some of them.  Your example has 2 columns and they appear to be empty.  And your not binding to an observable collection.

    I changed my code to match the way you are binding:
      From:   grdMain.ItemsSource = App.CollectionName;
     To:   grdMain.DataContext = App.CollectionName;
    The grid showed quickly, but empty.

    App.CollectionName is the observable collection this is stored at a global level in the app.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Aug 2010 Link to this post

    Hello Cuthahotha,

    You can find attached the same example however the grid is bound to ObservableCollection of object with 20 properties with long strings. 

    Sincerely yours,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Cuthahotha
    Cuthahotha avatar
    81 posts
    Member since:
    Sep 2008

    Posted 09 Aug 2010 Link to this post

    Thanks Vlad,

    Project won't open on my work computer, but I was able to at least view the files.  It appears you're setting the data context for the host control to the observable collection, instead of setting the item source?  I think that will work for my app.  I'll check it at home tonight. 
  7. Cuthahotha
    Cuthahotha avatar
    81 posts
    Member since:
    Sep 2008

    Posted 09 Aug 2010 Link to this post

    Ok.

    The problem is fixed.  What it turns out is that the columns I've put in are temp holding.  Not all of them exist in the collection yet.  As soon as I paired back to what was represented in the collection the speed improved.

    If you add the columns below to the grid you'll see the behaviour.  I did this to the sample project and it took 15 seconds to load.  Change out to names from the collection and the speed was back to a second or two.

     

     

     

    <telerikGrid:GridViewDataColumn Header="Title" DataMemberBinding="{Binding Title}" />

     

     

     

     

    <telerikGrid:GridViewDataColumn Header="City" DataMemberBinding="{Binding City}" />

     

     

     

     

    <telerikGrid:GridViewDataColumn Header="Country" DataMemberBinding="{Binding Country}" />

     

     

     

     

    <telerikGrid:GridViewDataColumn Header="Phone" DataMemberBinding="{Binding HomePhone}" Width="*"/>

     

Back to Top
DevCraft banner