Performance Issue with GridView inside TileView

13 posts, 1 answers
  1. Ruben Hakopian
    Ruben Hakopian avatar
    37 posts
    Member since:
    Nov 2009

    Posted 25 Jun 2010 Link to this post

    Hi,

    I have encountered a performance issue when adding gridView inside RadTileItem.
    CPU starts spinning and process starts to consume lots of memory, until it reaches 2GBs and eventually crashes.

    Attached is a snippet from a demo application which presents a standalone gridview performance (which works fine), and the same gridview inside RadTileItem.

    XAML:
            <telerik:RadTileView Grid.Row="1">  
                <telerik:RadTileViewItem Header="ABC">  
                      
                    <telerik:RadFluidContentControl>                      
                        <telerik:RadFluidContentControl.Content> 
                            <TextBlock Text="Maximize this tile." /> 
                        </telerik:RadFluidContentControl.Content> 
                          
                        <telerik:RadFluidContentControl.SmallContent> 
                            <TextBlock Text="Maximize this tile." /> 
                        </telerik:RadFluidContentControl.SmallContent> 
                          
                        <telerik:RadFluidContentControl.LargeContent> 
     
     
        <Grid> 
            <Grid.RowDefinitions> 
                <RowDefinition Height="Auto" /> 
                <RowDefinition /> 
            </Grid.RowDefinitions> 
     
            <Button Height="20" Content="Generate" Click="Button_Click" /> 
     
            <telerik:RadGridView Name="telerikGrid" Grid.Row="1" 
                                 ItemsSource="{Binding Persons, Mode=OneWay}" 
                                 IsReadOnly="True" 
                                 AutoGenerateColumns="False">  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=ID, Mode=OneWay}" Header="ID" IsGroupable="False" IsFilterable="False"  /> 
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Name, Mode=OneWay}" Header="Name" IsGroupable="False" IsFilterable="False"  /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 
        </Grid> 
                        </telerik:RadFluidContentControl.LargeContent>                      
                    </telerik:RadFluidContentControl> 
                      
                </telerik:RadTileViewItem> 
            </telerik:RadTileView> 

    Code Behind:

        public partial class GridControl : UserControl  
        {  
            public GridControl()  
            {  
                InitializeComponent();  
                this.DataContext = new ViewModel();  
            }  
     
            private void Button_Click(object sender, RoutedEventArgs e)  
            {  
                var list = new List<Person>();  
                for (int i = 0; i < 10000; i++)  
                {  
                    list.Add(new Person(i, "abc"));  
                }  
                (this.DataContext as ViewModel).Persons = list;  
            }  
        }  
     
        public class ViewModel : INotifyPropertyChanged  
        {  
            private List<Person> _persons = null;  
     
            public List<Person> Persons  
            {  
                get { return _persons; }  
                set { _persons = value; OnPropertyChanged("Persons"); }  
            }
            #region INotifyPropertyChanged Members  
     
            public event PropertyChangedEventHandler PropertyChanged;  
            private void OnPropertyChanged(string propertyName)  
            {  
                if (PropertyChanged != null)  
                    PropertyChanged(thisnew PropertyChangedEventArgs(propertyName));  
            }
            #endregion  
        }  
     
        public class Person  
        {  
            private int _id;  
            private string _name;  
     
            public Person(int id, string name)  
            {  
                _id = id;  
                _name = name;  
            }  
     
            public int ID  
            {  
                get { return _id; }  
            }  
     
            public string Name  
            {  
                get { return _name; }  
            }  
     
        } 



    Thank you very much,

    Ruben.
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 29 Jun 2010 Link to this post

    Hi Ruben,

    Thank you for reporting this issue. In fact, the issue is caused by the RadFluidContentControl. For some reason it takes more time for an ItemsControl to generate its ItemsSource when in RadFluidContentControl rather than not being in RadFluidContentControl. I've added this issue in our public issue tracking system and we will do our best to fix it as soon as possible. The name of the item in the public issue tracking system is "FluidContentControl: Performance issue when and ItemsControl generates its items" and it will be available for tracking and voting tomorrow the latest. Let me know how I can be of further assistance.

    Regards,
    Kiril Stanoev
    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. UI for WPF is Visual Studio 2017 Ready
  4. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 29 Jun 2010 Link to this post

    HI Kiril,

    Thank you for submitting the bug. Can you provide a time frame when this issue will be resolved?
    Currently this issue is a show stopper for our product, which is supposed to be released soon.

    Thank you very much!

    Ruben.
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 01 Jul 2010 Link to this post

    Hi Ruben,

    we have an official release in two weeks. We will do our best to include a fix, but we can't promise that it will be fixed until then. You can track the issue status here.

    Greetings,
    Kiril Stanoev
    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. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 01 Jul 2010 Link to this post

    Hi,

    Can you guys provide the source code for FluidContentControl?
    I may try to do some tricks and try to fix it.

    Thank you,
    Ruben.
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 04 Jul 2010 Link to this post

    Hi Ruben,

    I found a quick workaround which you might want to use while we investigate the actual cause for the issue.
    Setting explicit size (Width, Height, MaxWidth or MaxHeight) to the root panel in the LargeContent will significantly boost the time RadGridView generates its items.

    <telerikNavigation:RadTileView Grid.Row="1">
        <telerikNavigation:RadTileViewItem Header="ABC">
            <telerik:RadFluidContentControl>
                <telerik:RadFluidContentControl.SmallContent>
                    <TextBlock Text="Maximize this tile." />
                </telerik:RadFluidContentControl.SmallContent>
                <telerik:RadFluidContentControl.Content>
                    <TextBlock Text="Maximize this tile." />
                </telerik:RadFluidContentControl.Content>
                <telerik:RadFluidContentControl.LargeContent>
                    <!--<Grid MaxWidth="1500" MaxHeight="1500">-->
                    <Grid Width="1024" Height="768">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Button Height="20" Content="Generate" Click="Button_Click" />
                        <telerikGridView:RadGridView Name="telerikGrid" Grid.Row="1"
                                ItemsSource="{Binding Persons, Mode=OneWay}" IsReadOnly="True"
                                AutoGenerateColumns="False">
                            <telerikGridView:RadGridView.Columns>
                                <telerikGridView:GridViewDataColumn
                                        DataMemberBinding="{Binding Path=ID, Mode=OneWay}"
                                        Header="ID" IsGroupable="False" IsFilterable="False" />
                                <telerikGridView:GridViewDataColumn
                                        DataMemberBinding="{Binding Path=Name, Mode=OneWay}"
                                        Header="Name" IsGroupable="False" IsFilterable="False" />
                            </telerikGridView:RadGridView.Columns>
                        </telerikGridView:RadGridView>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
    </telerikNavigation:RadTileView>

    Give it a try and let me know if this will work for the moment.

    Regards,
    Kiril Stanoev
    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
  8. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 06 Jul 2010 Link to this post

    Kirill,

    Thanks for the workaround. How do i know what should be the size of the grid? Do you know if there is a way to make it fit available space? If the window is being resized I might need to resize the grid so it does not get out of the boundaries.

    Thanks,
    Ruben.
  9. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 07 Jul 2010 Link to this post

    Hi Ruben,

    We managed to resolve the issue with RadFluidContentControl. The fix will be available with our official Q2 release. As for the moment, simply set MaxWidth="1500" and MaxHeight="1500" (or some other large value) and see which one suits you most. I don't think that your GridView will exceed more than 1500x1500 px. Setting MaxWidth and MaxHeight will improve the performance and is a valid workaround until you get the release binaries.

    Kind regards,
    Kiril Stanoev
    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
  10. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 07 Jul 2010 Link to this post

    Hi Kiril,

    Thank you guys very much! Looking forward to get the new version of your products.
    When is the Q2 release scheduled?

    Thanks,
    Ruben.
  11. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 07 Jul 2010 Link to this post

    Hello rubenhak,

    The release will be next week.

    Kind regards,
    Valentin.Stoychev
    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
  12. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 07 Jul 2010 Link to this post

    Hi Valentin,

    Sound perfect to me!

    Thanks,
    Ruben

  13. Jorge Alberto
    Jorge Alberto avatar
    38 posts
    Member since:
    Dec 2009

    Posted 12 Jul 2010 Link to this post

    Hello 

    I have the same problem, does the latest release comes with the fix for this issue?

    Best Regards
  14. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 15 Jul 2010 Link to this post

    Hi Jorge,

    Yes, the latest release includes the fix. Download our latest binaries, give them a try and let us know if you encounter the same issue again.

    Regards,
    Kiril Stanoev
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready