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

Performance Issue with RadGrid

6 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 21 Jan 2009, 04:56 PM
If someone could help me understand a performance issue I'm having with the RadGrid I would be very grateful

I'm displaying a list of Orders, each one has a DetailView of the Lines in that Order. There are around 2000 orders. The Order Lines in the DetailView are loaded on demand, and I've double-checked the datasource is not getting hit, so I'm guessing that has nothing to do with the performance.

I've traced the page, and the PreRender Event takes around 5 seconds. The database query takes about 0.5, my conversion from a Business Object to a Dataset takes 0.4 seconds, but I'm at a loss as to what that other 4 seconds is for.

Could someone give me a pointer please?

        <!-- ***    Main Grid DataSources   *** --> 
         
        <asp:ObjectDataSource ID="odsCustomers" runat="server" SelectMethod="GetList" TypeName="MyProject.BLL.ListValuesDataSource" > 
            <SelectParameters> 
                <asp:Parameter DefaultValue="Customers" Name="ListName" Type="String" /> 
            </SelectParameters> 
        </asp:ObjectDataSource>    
          
        <asp:ObjectDataSource ID="odsSalesOrderHeaders" runat="server" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetSalesOrderHeadersByCustomerIDCompletedDataSet" TypeName="MyProject.BLL.SalesOrderHeadersDataSource">   
            <SelectParameters> 
                <asp:Parameter Name="CustomerID" DefaultValue="0" /> 
                <asp:Parameter Name="Status" DefaultValue="CURRENT" /> 
            </SelectParameters> 
        </asp:ObjectDataSource>  
         
        <asp:ObjectDataSource ID="odsSalesOrderLines" runat="server" SelectMethod="GetSalesOrderLinesByOrderHeaderIDDataSet" TypeName="MyProject.BLL.SalesOrderLinesDataSource">           
            <SelectParameters> 
                <asp:SessionParameter Name="OrderHeaderID" SessionField="SelectedRecordKey" Type="Int32" />             
            </SelectParameters>         
        </asp:ObjectDataSource> 
 
    <!-- ***************************************************************************** 
         * Order Headers Grid                                                        * 
         ***************************************************************************** -->                                            
         
        <div class="gridWrapper"
         
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="odsSalesOrderHeaders" AutoGenerateColumns="False" OnLoad="RadGridFormatColumns"
                <HeaderContextMenu EnableTheming="True"
                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                </HeaderContextMenu> 
                <MasterTableView ClientDataKeyNames="OrderID" DataSourceID="odsSalesOrderHeaders" DataKeyNames="OrderID" AllowFilteringByColumn="True"
                                      
                    <DetailTables>                                                      
                        <telerik:GridTableView DataSourceID="odsSalesOrderLines" ClientDataKeyNames="OrderHeaderID" DataKeyNames="OrderHeaderID" Width="100%" > 
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="OrderHeaderID" MasterKeyField="OrderID" /> 
                            </ParentTableRelation>                         
                            <Columns> 
                                <telerik:GridBoundColumn DataField="OrderLineID" Visible="false" /> 
                                <telerik:GridBoundColumn DataField="FK_ProductName" HeaderText="Product" /> 
                                <telerik:GridBoundColumn DataField="FK_PriceCode" HeaderText="Price Code" /> 
                                <telerik:GridBoundColumn DataField="FK_PriceDescription" HeaderText="Price Desc." />                             
                                <telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" /> 
                                <telerik:GridBoundColumn DataField="SalePrice" HeaderText="SalePrice" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" /> 
                                <telerik:GridBoundColumn DataField="SaleValue" HeaderText="SaleValue" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" /> 
                            </Columns>                         
                        </telerik:GridTableView>                     
                    </DetailTables> 
                     
                    <Columns>                                         
                                     
                        <telerik:GridBoundColumn DataField="CustomerID" Visible="false" />                     
                        <telerik:GridHyperLinkColumn DataTextField="OrderID" HeaderText="Ref" DataNavigateUrlFields="OrderID" DataNavigateUrlFormatString="SalesOrderDetails.aspx?order={0}" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%" />                                           
                        <telerik:GridBoundColumn DataField="FK_CustomerName" HeaderText="Customer" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%" />                                                                                                                         
                                                                                                                                                                                                                                                
                        <telerik:GridBoundColumn DataField="Department"  HeaderText="Dept." Visible="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%" />                            
                         
                        <telerik:GridBoundColumn DataField="AssociateSurname"  HeaderText="Patient" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%" />                            
                                                                        
                        <telerik:GridBoundColumn DataField="Required" HeaderText="Required" Visible="false" DataType="System.DateTime" />                                 
                        <telerik:GridBoundColumn DataField="FK_OrderStatus" HeaderText="Status" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%" />                                                                                                                                                 
                    </Columns>                  
 
                    <RowIndicatorColumn Visible="True"
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                </MasterTableView> 
                 
                <FilterMenu EnableTheming="True"
                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                </FilterMenu> 
                 
                <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">                             
                    <Resizing AllowColumnResize="True" /> 
                    <Selecting AllowRowSelect="true" /> 
                    <ClientEvents OnRowDblClick="RadGrid1_RowDblClick" />  
                </ClientSettings>                       
            </telerik:RadGrid>     

6 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 26 Jan 2009, 01:30 PM
Hi Rick,

The PreRender event is inherited from Control object. It is fired when the server control is about to render to its containing Page object. So the time to execute this event depends primarily on what is the size of the markup code, which has to be rendered.

In your case in initial load the PreRender event should be executed faster than the cases when the detail tables are open too.

To increase the performance you can try to use paging or to decrease the number of the columns, which are rendered.

Regards,
Georgi Krustev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rick
Top achievements
Rank 1
answered on 26 Jan 2009, 01:45 PM
Hi Georgi,

This is what is confusing. I AM using paging, and the page size is only 15 records.

I've checked the HTML and the rendered code is only 95KBs.

I can't work out why its so slow?
0
Rick
Top achievements
Rank 1
answered on 26 Jan 2009, 02:57 PM
Thanks, I've resolved this.

The main problem appeared to be down to a date field. For some reason it was slowing down the load and the paging by at least 2 seconds for a table of 2000 records, even with visible set to false.
0
Mark DeMichele
Top achievements
Rank 1
answered on 07 Feb 2009, 01:48 PM
I'm just curious.  What browser were you using.  Are you sure the delay isn't on the client.  I have a grid, that I update using AJAX.  In IE6 it takes about 7 seconds.  The time spent on the server is under a second. The rest of the time is spent on the client.  I verified this with fiddler.  If I use FireFox 3, the whole process takes about 2 seconds.  IE7 takes about 3-4 seconds.  I'm still not sure why, but figured I would throw it out there.
0
Rick
Top achievements
Rank 1
answered on 08 Feb 2009, 02:34 PM
That was using Google Chrome

It was definitely down to a date field. I'd be happy to provide more code samples if the Telerik Team want to investigate this further. It was definitely down to a Date Field.
0
Sebastian
Telerik team
answered on 09 Feb 2009, 07:18 AM
Hi Rick,

If you can replicate the issue in a working test project, feel free to submit it via our support ticket system for further investigation. We will debug it locally and will get around to you with our findings.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Rick
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Rick
Top achievements
Rank 1
Mark DeMichele
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or