This is a migrated thread and some comments may be shown as answers.

Performance Question

5 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cuthahotha
Top achievements
Rank 1
Cuthahotha asked on 23 Jul 2010, 02:26 PM
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>

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 27 Jul 2010, 12:34 PM
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
0
Cuthahotha
Top achievements
Rank 1
answered on 09 Aug 2010, 02:36 PM
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.
0
Vlad
Telerik team
answered on 09 Aug 2010, 02:59 PM
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
0
Cuthahotha
Top achievements
Rank 1
answered on 09 Aug 2010, 06:43 PM
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. 
0
Cuthahotha
Top achievements
Rank 1
answered on 09 Aug 2010, 08:09 PM
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="*"/>

 

Tags
GridView
Asked by
Cuthahotha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Cuthahotha
Top achievements
Rank 1
Share this question
or