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

Radgrid performance is slow

3 Answers 542 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mahesh V
Top achievements
Rank 2
Mahesh V asked on 19 Jul 2012, 01:13 PM
Hi,

I am binding the grid with datasource(that contains four tables and datarelation) . When I expand the grids in heirarchy,It takes lots of seconds .Please note that this grid hardly contain only one record at top level.Here is my code:

  <telerik:RadGridView RowIndicatorVisibility="Collapsed" AutoGenerateColumns="True" ItemsSource="{Binding}"
                             ScrollViewer.CanContentScroll="True" Name="radGridView2"  Height="500" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible"
                                             LoadingRowDetails="radGridView2_LoadingRowDetails"
                                              RowLoaded="radGridView2_RowLoaded"  DataLoadMode="Asynchronous"
                                             CellLoaded="radGridView2_CellLoaded" Initialized="radGridView2_Initialized" DataLoading="radGridView2_DataLoading" CanUserReorderColumns="False"  VerticalAlignment="Stretch" EnableColumnVirtualization="True" EnableRowVirtualization="True">
                                            </telerik:RadGridView> 

,I have set the height of nested grids at runtime .this is the code behind for that:
  private void radGridView2_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
              GridViewDataControl dataControl = (GridViewDataControl) sender;
           
              if (dataControl.ParentRow != null)
              {              
                  dataControl.ShowGroupPanel = false;
                  dataControl.ShowColumnHeaders = false;            
                  dataControl.RowLoaded += new EventHandler<RowLoadedEventArgs>(dataControl_RowLoaded);
                  dataControl.Height = 300;
           
              }
             
        }

Please let me know what is the issue ?

Thanks in Advance

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Jul 2012, 01:22 PM
Hello,

Generally to increase the performance of the GridView please try not to place RadGridView in controls/panels which will measure it with infinity. More on how to increase the performance is described in this help article

I would like to ask you to remove the DataLoadMode setting as well. May I ask you what additional logic do you perform when a cell/row is loaded?

Please note that I was not able to notice such a performance problems on our online demos

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mahesh V
Top achievements
Rank 2
answered on 20 Jul 2012, 06:05 AM
Hi,

I have removed DataLoadMode setting but it is still not affecting the performance and grid is not placed inside any panel.It is inside a tabcontrol, which is inside a user control.and  I need to rename some of the headers at runtime so I used row loaded event for that.

Even when I commented the whole code for row_loaded,its taking almost same time.First time when Grid is bound time is ok,but when I expand the heirarchy it takes too long.Can you please suggest some idea why it is happening?

Thanks
0
Dimitrina
Telerik team
answered on 20 Jul 2012, 03:40 PM
Hello,

 I am not sure what is causing the performance problem. You may check the Degraded Performance help article as well.

If the problem still remains, can you isolate it in a sample project and send it to us? We will check what is going on and will assist you further.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Mahesh V
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Mahesh V
Top achievements
Rank 2
Share this question
or