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

Bug: Slow data load

2 Answers 62 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 13 Jun 2011, 11:29 AM
Hi

I've just noticed that the RadTileView control is introducing an unacceptably long load time into my application. I have a page with two RadTileViewItems and both items contain ordinary toolkit datagrids that bind to data loaded via the page's ViewModel.The second of these datagrids, which contains about 3,000 records, can take anything between 10-20s to load, despite the data coming from a very fast procedure. In investigating I noticed that when I move the grid out of the RadTileView and just put in a new row alongside the RadTileView, the page loads almost instantaneously. What is the RadTileView doing in this case? Why is it slowing everything down?

Thanks

2 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 15 Jun 2011, 11:45 AM
Hello Stuart,
Could you please give us some code snippets or a sample project because when I tried your scenario everything was working fine (I tried it with 9000 items and they loaded almost instantly)?
Here is how I implemented it:
MyItem.cs
public class MyItem
{
    private EntitySet brands;
  
    public string Header { get; set; }
    public EntitySet Brands
    {
        get
        {
            return brands;
        }
        set
        {
            brands = value;
        }
    }
}
MainViewModel.cs
public class MainViewModel
{
    private ObservableCollection<MyItem> items;
  
    public MainViewModel()
    {
        CarsDomainContext context = new CarsDomainContext();
        this.items = new ObservableCollection<MyItem>();
  
        MyItem first = new MyItem() { Header = "First" };
        MyItem second = new MyItem() { Header = "Second" };
  
        second.Brands = context.Brands;
        context.Load(context.GetBrandsQuery());
  
        this.items.Add(first);
        this.items.Add(second);
    }
  
    public ObservableCollection<MyItem> Items
    {
        get
        {
            return items;
        }
    }
}
And the XAML is:
<telerik:RadTileView ItemsSource="{Binding Items}" MinimizedColumnWidth="250">
    <telerik:RadTileView.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Header}" />
        </DataTemplate>
    </telerik:RadTileView.ItemTemplate>
    <telerik:RadTileView.ContentTemplate>
        <DataTemplate>
            <sdk:DataGrid ItemsSource="{Binding Brands}" />
        </DataTemplate>
    </telerik:RadTileView.ContentTemplate>
</telerik:RadTileView>


Kind regards,
Zarko
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
Stuart
Top achievements
Rank 1
answered on 15 Jun 2011, 04:31 PM
Thanks Zarko. I've just created a test project with my stripped out code - minus the converters etc - and it appears to be loading fine! I'm not sure what was causing the delay in the original project - probably bad coding in the converters on my part? - but it certainly doesn't appear to be the TileViewItem. Feel free to delete this thread as necessary and thanks for your time.
Tags
TileView
Asked by
Stuart
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Stuart
Top achievements
Rank 1
Share this question
or