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

Performance Issue with Virtualization off

5 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dhileep Kumar Sampath
Top achievements
Rank 1
Dhileep Kumar Sampath asked on 09 Sep 2010, 02:35 PM
Hi Telerik Team,
                       We are using gridview in a page and because of merging and disabling few cells based on the context, We turned off virtualization. This in turn is affecting the performance drastically as we are loading 25 rows and 15 columns on average. This takes approximately 4 secs to load the UI screen which we want to reduce to 1 sec. Please let me know if there is any work around.


Grid:
<radgridview:RadGridView x:Name="radgvMatrix"                                  
                                    EnableColumnVirtualization="False"
                                    EnableRowVirtualization="False"  
                                    AutoGenerateColumns="False"
                                    RowLoaded="radgvMatrix_RowLoaded">
           <radgridview:RadGridView.Columns>
               <radgridview:GridViewDataColumn Header="Parameter Parent" UniqueName="Parent" DataMemberBinding="{Binding Parent}" IsReadOnly="True" MinWidth="120"/>
                
               <radgridview:GridViewDataColumn Header="Parameter Name" UniqueName="Parameter" MinWidth="120"/>                  
                
               <radgridview:GridViewDataColumn Header="Score1" UniqueName="Score" TextAlignment="Center" DataMemberBinding="{Binding Score1}" IsReadOnly="True" MinWidth="100"/>
               <radgridview:GridViewDataColumn Header="Score2" UniqueName="Score" TextAlignment="Center" DataMemberBinding="{Binding Score2}" IsReadOnly="True" MinWidth="100"/>
               <radgridview:GridViewDataColumn Header="Score3" UniqueName="Score" TextAlignment="Center" DataMemberBinding="{Binding Score3}" IsReadOnly="True" MinWidth="100"/>
               <radgridview:GridViewDataColumn Header="Score4" UniqueName="Score" TextAlignment="Center" DataMemberBinding="{Binding Score4}" IsReadOnly="True" MinWidth="100"/>               
           </radgridview:RadGridView.Columns>
       </radgridview:RadGridView>


Data Class:

public class DataRow
   {
       public string Parent
       { get; set; }
 
       public string Parameter
       { get; set; }
 
       public int Score1
       { get; set; }
 
       public int Score2
       { get; set; }
 
       public int Score3
       { get; set; }
 
       public int Score4
       { get; set; }
   }


SetData method called from constructor of the Page:

private void SetData()
        {
            DataRows = new ObservableCollection<DataRow>();
            int count = 50;
 
            for (int i = 0; i < count; i++)
            {
                DataRow row = new DataRow();
                row.Parameter = "Parameter " + i.ToString();
                row.Parent = "Parent " + i.ToString();
                row.Score1 = 1 * i;
                row.Score2 = 2 * i;
                row.Score3 = 3 * i;
                row.Score4 = 4 * i;
 
                DataRows.Add(row);               
            }
 
            this.radgvMatrix.ItemsSource = DataRows;
        }


Please let me know if you need more info.

Regards,
Dhileep

5 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 13 Sep 2010, 02:01 PM
Hi Dhileep Kumar Sampath,

This performance degradation is expected when virtualization is turned off. My suggestion is to turn it on and use RowLoaded and RowUnloaded events to set your specific properties. In RowLoaded you will set them and in RowUnloaded you will remove your set property values in order for the virtualization to work correctly.

Greetings,
Stefan Dobrev
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
Dhileep Kumar Sampath
Top achievements
Rank 1
answered on 17 Sep 2010, 05:24 PM
Hi Stefan Dobrev ,
      Thanks for your response. Your suggestion helped me in improving the performance. I have one more issue now. I am using your extension method ChildrenOfType extensively in the RowLoaded events which is causing performance issues. Can you please let me know if this is expected behaviour or is there any alternate way for this?
0
Maya
Telerik team
answered on 21 Sep 2010, 04:00 PM
Hi Dhileep Kumar Sampath,

How exactly are you implementing the ChildrenOfType<> extension method ? It would be great if you could send us a sample project so that we could see your exact requirements and settings. Thus we will be able to suggest you an appropriate optimization mechanism for the application.
 

Greetings,
Maya
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
Makarand
Top achievements
Rank 1
answered on 25 Apr 2013, 11:33 AM
can u give us an example or can you provide any project for that.
0
Maya
Telerik team
answered on 25 Apr 2013, 12:47 PM
Hi Makarand,

Will it be possible to clarify a bit - what is your sceanrio, what example do you require ? Do you want to work with ChildrendOfType<T>() extension method ? If so, you can check out this blog post for a reference. 
 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Dhileep Kumar Sampath
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Dhileep Kumar Sampath
Top achievements
Rank 1
Maya
Telerik team
Makarand
Top achievements
Rank 1
Share this question
or