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

Performance Problem in RadGrid Hierarhy

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
utchi
Top achievements
Rank 1
utchi asked on 23 Mar 2010, 01:40 PM

Hi,

I have very slow performance of displaying records in radgrid hierarchial. I m displaying some 1000 records in radgrid intially, but taking morethan 40 secs to load.

I have refered and implemented the options metioned in the following url, but i m  still struggling with this,
http://www.telerik.com/help/aspnet-ajax/grdviewstatereductiontechniques.html

Code snippet

<telerik:RadGrid runat="server" ID="grdProgram_CommercialDetails" Height="285px" EnableViewState="false" 
                AllowPaging="True"  AllowMultiRowSelection="false" OnDetailTableDataBind="grdProgram_CommercialDetails_DetailTableDataBind" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="true" OnDeleteCommand="grdProgram_CommercialDetails_DeleteCommand" OnEditCommand="grdProgram_CommercialDetails_EditCommand" OnItemDataBound="grdProgram_CommercialDetails_ItemDataBound" OnUpdateCommand="grdProgram_CommercialDetails_UpdateCommand" 
                PageSize="5"  AllowSorting="true" PagerStyle-Mode="NextPrevNumericAndAdvanced" AutoGenerateColumns="false" ShowStatusBar="true" AllowFilteringByColumn="true" OnNeedDataSource="grdProgram_CommercialDetails_NeedDataSource" OnItemDeleted="grdProgram_CommercialDetails_ItemDeleted">     
                <MasterTableView DataKeyNames="Program_Id,Segment" AllowFilteringByColumn="true" AutoGenerateColumns="false" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="true" OnPreRender="grdProgram_CommercialDetails_PreRender" HierarchyLoadMode="ServerOnDemand">  
                <Columns> 
                <telerik:GridClientSelectColumn UniqueName="prog_comm" HeaderStyle-Width="20px"/>  
                <telerik:GridBoundColumn DataField="Program_Id" HeaderText="Program_Id" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProgrammeName" HeaderText="Programme" Display="true" FilterControlWidth="50px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProgrammeType" HeaderText="ProgrammeType" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Commercial" HeaderText="BreakEvents" Display="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Episode" HeaderText="Episode" Display="true" FilterControlWidth="40px" HeaderStyle-Width="75px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Repeat" HeaderText="Repeat" Display="true" FilterControlWidth="40px" HeaderStyle-Width="75px"></telerik:GridBoundColumn> 
                <telerik:GridDateTimeColumn UniqueName="DateTime1"  DataFormatString="{0:d}" FilterControlWidth="86px" HeaderStyle-Width="110px" 
                        SortExpression="DateTime" HeaderText="DateTime" DataField="DateTime">  
                 </telerik:GridDateTimeColumn>    
                 <telerik:GridBoundColumn DataField="DateTime" HeaderText="Datetime" Display="false"></telerik:GridBoundColumn> 
                   
                <telerik:GridBoundColumn DataField="StartTime" HeaderText="StartTime" FilterControlWidth="40px" Display="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="EndTime" HeaderText="EndTime" FilterControlWidth="40px" Display="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Segment" HeaderText="Segment" Display="true" FilterControlWidth="40px"></telerik:GridBoundColumn> 
                  
 
                </Columns> 
                <DetailTables> 
                  
                <telerik:GridTableView AllowAutomaticDeletes="true" DataKeyNames="Program_Id" DataSourceID="SqlDataSource2" CommandItemDisplay="Bottom" Width="600px" Name="grd1" HierarchyLoadMode="ServerOnDemand"  >      
                 
                <ParentTableRelation> 
                  <telerik:GridRelationFields DetailKeyField="Program_Id" MasterKeyField="Program_Id" /> 
                </ParentTableRelation> 
 
                <Columns> 
                <telerik:GridClientSelectColumn UniqueName="Prog_Comm_Select" HeaderStyle-Width="35px" /> 
                <telerik:GridBoundColumn DataField="Program_Id" HeaderText="Program_Id" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProgrammeName" HeaderText="ProgrammeName" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                  
                  
                <telerik:GridBoundColumn DataField="Commercial" HeaderText="BreakEvents" Display="true" ReadOnly="true" FilterControlWidth="50px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProgrammeType" HeaderText="Type" Display="true" ReadOnly="true" FilterControlWidth="50px" HeaderStyle-Width="85px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="StartTime" HeaderText="StartTime" Display="true" ReadOnly="true" FilterControlWidth="40px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="EndTime" HeaderText="EndTime" Display="true" ReadOnly="true" FilterControlWidth="40px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="BreakPosition" HeaderText="BreakPosition" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ReleaseOrderNo" HeaderText="ReleaseOrderNo" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="DateTime" HeaderText="DateTime" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Repeat" HeaderText="Repeat" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Episode" HeaderText="Episode" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="breaks" HeaderText="breaks" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="AdPosition" HeaderText="AdPosition" Display="false" ReadOnly="true"></telerik:GridBoundColumn> 
              
              
              
              
                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Adposition" 
                        SortExpression="Adposition" FilterControlWidth="40px">  
                        <FooterTemplate>Template footer</FooterTemplate> 
                        <FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" /> 
                        <ItemTemplate> 
                            <%#DataBinder.Eval(Container.DataItem,"Adposition")%> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <telerik:RadComboBox DataTextField="Adposition"   
                             DataValueField="Adposition"   
                             OnItemsRequested="RadComboBox1_ItemsRequested" 
                                EnableLoadOnDemand="True"   
                                ID="RadComboBox1"   
                                runat="server"   
                                Height="140px" 
                                Width="220px" 
                                SelectedValue='<%#Bind("Adposition") %>'   
                                DataSourceID="SqlDataSource2">  
                            </telerik:RadComboBox> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                          
               <%--<telerik:GridDropDownColumn DataField="Adposition" HeaderText="AdPosition" Display="true"></telerik:GridDropDownColumn>--%> 
               <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Do you want to delete?" 
                                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1" HeaderText="Delete" HeaderStyle-Width="40px">  
                             <ItemStyle HorizontalAlign="Center"/>  
               </telerik:GridButtonColumn>                              
               <telerik:GridEditCommandColumn ButtonType="ImageButton" Display="true" HeaderText="Edit" HeaderStyle-Width="40px"></telerik:GridEditCommandColumn> 
                </Columns> 
                 <CommandItemTemplate> 
                            <input type="Button" value="MoveDown" style="background-image: url('~/Images/arrow_marble_down.gif');" onclick="moveRowDown()">  
                              
                            <input type="Button" value="MoveUp" style="background-image: url('~/Images/arrow_marble_up.gif');" onclick="moveRowUp()">  
                            
                            
                            
                 </CommandItemTemplate> 
                </telerik:GridTableView> 
                  
                </DetailTables> 
                  
                </MasterTableView> 
                <SelectedItemStyle BackColor="BurlyWood" ForeColor="Black" Font-Bold="true" /> 
                  
                <ClientSettings AllowRowsDragDrop="True">  
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/>  
                    <ClientEvents OnRowSelected="RadGrid1_RowSelected"></ClientEvents> 
                      
                    <Scrolling AllowScroll="true" UseStaticHeaders="true"/>  
                </ClientSettings> 
            </telerik:RadGrid> 

 

Please give any suggestions.

 

Regards,

Maha;)

1 Answer, 1 is accepted

Sort by
0
Accepted
Schlurk
Top achievements
Rank 2
answered on 23 Mar 2010, 04:05 PM
If you look over the various Hierarchical and Group load modes (discussed in this documentation section) I think these can also help you since you mention that you are using hierarchies.
Tags
Grid
Asked by
utchi
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or