Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Why the performance of UltraWebGrid is so slow? Can anyone help me about the issue?
posted

Hi,

  Currently I use the Infragistics.WebUI.UltraWebGrid in my web application. I develop my application in VS 2008 and .net Framework 2.0.50727. I used the ultrawebgrid and bind it to sqlDataSource. I also set allow paging for ultrawebgrid. When I retrieved 20000 records, it will takes me about 3 minutes or sometimes it does not come out any results ( look like still running). But when I retrieved 150 records, it will takes me about 5 seconds. I am wondering that whether ultraWebgrid has the performance issue. When I replace ultrawebgrid with gridview, When I retrieved 20000 records, it only takes 5 seconds. Because I will use the pretty user interface from ultrawebgrid, I hope anybody can help me solve the problem or does anyone have the same problem before.  By the way, I have another issue, why ultrawebgrid everytime need to rebind  again but gridview we don't need to bind again, how can we get the records from ultrawebgrid without rebinding for postback.

I put my test source code as follows:

In Web.config, you can set up

<connectionStrings>
   <add name="results_developmentConnectionString2" connectionString="Data Source=Server Name;Initial Catalog=Database Name;Persist Security Info=True;User ID=XXXX;Password=XXXX"/>
 </connectionStrings>

in GridTest.aspx.vb

Partial Class GridTest
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SqlDMC_Main.ConnectionString = ConfigurationManager.ConnectionStrings("results_developmentConnectionString2").ToString()
           UltraWebGridDMC_Main.DataBind()
    End Sub
End Class

 In GridTest. aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="GridTest.aspx.vb" Inherits="GridTest" %>

<%@ Register assembly="Infragistics2.WebUI.UltraWebGrid.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <igtbl:UltraWebGrid ID="UltraWebGridDMC_Main" runat="server" DataSourceID="SqlDMC_Main"  DataKeyField="ActivityID">
     <bands>
            <igtbl:UltraGridBand DataKeyField="ActivityID">
                <Columns>
                    <igtbl:TemplatedColumn AllowResize="Free" Width="30px" SortIndicator="Disabled">
                    <CellTemplate>
                    <asp:ImageButton ID="btnSelect" CommandArgument="Select" CommandName="cmdSelectDetail" runat="server" ImageUrl="~/IMAGES/list.gif" />
                    </CellTemplate> 
                    <CellStyle Width="30px" wrap="false"></CellStyle>        
                    </igtbl:TemplatedColumn>
                   
                    
                    <igtbl:TemplatedColumn  Key="Completed" BaseColumnName="Completed"  Hidden="false" AllowResize="Free" Width="30px" DataType="System.String" >
                    <CellTemplate>
                    <asp:CheckBox ID="ChkCompleted" runat="server" Enabled="false" Checked='<%# iif(Eval("Completed").ToString()="Y",true,false) %>' />                                                           
                    </CellTemplate>   
                    <CellStyle width="10px" Wrap="false"></CellStyle>               
                    <Header Caption="Completed">                
                       <RowLayoutColumnInfo OriginX="1">
                       </RowLayoutColumnInfo>
                    </Header>
                  <Footer>
                      <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                  </Footer>
                  </igtbl:TemplatedColumn>
                 
                   
                   
                    <igtbl:TemplatedColumn  Key="ActivityID" BaseColumnName="ActivityID" Hidden="false" AllowResize="Free" Width="40px" DataType="System.Int32" >
                    <CellTemplate>
                    <asp:LinkButton ID="lbEdit" CommandArgument="Edit" CommandName="cmdEditDetail" runat="server" Text='<%#Eval("ActivityID")%>'>
                    </asp:LinkButton>
                    </CellTemplate>   
                    <CellStyle width="10px" Wrap="false"></CellStyle>               
                    <Header Caption="ID">                
                       <RowLayoutColumnInfo OriginX="1">
                       </RowLayoutColumnInfo>
                    </Header>
                  <Footer>
                      <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                  </Footer>
                  </igtbl:TemplatedColumn>
                   
                  <igtbl:UltraGridColumn BaseColumnName="ActivityID" DataType="System.Int32"
                        IsBound="True" Key="ActivityID"  Hidden="true">
                      <Header Caption="Activity ID" >                          
                              <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                      </Header>                     
                      <Footer>
                           <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                      </Footer>
                  </igtbl:UltraGridColumn>
                 
                   <igtbl:UltraGridColumn BaseColumnName="ActivityType" DataType="System.String"
                        IsBound="True" Key="ActivityType" AllowResize="Free" Width="100px">
                        <Header Caption="Activity Type">                       
                                 <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                        </Header>                     
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                        </Footer>
                  </igtbl:UltraGridColumn>
                  
                    <igtbl:UltraGridColumn BaseColumnName="Priority" IsBound="True" DataType="System.String"
                        Key="Priority"  AllowResize="Free" Width="20px">
                        <Header Caption="Priority" >                           
                                <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                        </Header>
                        <Footer>
                                <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="StartDate" Key="StartDate" IsBound="True"
                        AllowResize="Free" DataType="System.DateTime" Format="d"
                        Width="80px" Hidden="true">
                        <Header Caption="Start Date">                         
                                  <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                        </Header>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="StartDateTime" Key="StartDateTime" IsBound="True"
                        AllowResize="Free" DataType="System.DateTime" Format="g"
                        HTMLEncodeContent="false" width="120px" SortIndicator="Descending" >
                        <Header Caption="Start Date Time">                         
                                  <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                        </Header>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                      <igtbl:UltraGridColumn BaseColumnName="StartTime" Key="StartTime"
                        IsBound="True" Width="120px" Hidden="true"  DataType="System.String"
                        AllowResize="Free">
                        <Header Caption="Time">                        
                                <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo>
                        </Header>                      
                       <Footer>
                                <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo>
                       </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="TotalHours" Key="TotalHours"
                        IsBound="True" DataType="System.Decimal" Format="F2" Width="45px"
                        AllowResize="Free">
                        <Header Caption="Hours">                          
                                 <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
                        </Header>
                       <Footer>
                                <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
                       </Footer>
                    </igtbl:UltraGridColumn>
                   
                  
                    <igtbl:UltraGridColumn BaseColumnName="Description" Key="Description"
                        IsBound="True" Width="250px"  DataType="System.String" AllowResize="Free">
                        <Header Caption="Description">                         
                                 <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo>
                        </Header>
                         <CellStyle Width="200px" Wrap="false"></CellStyle>
                         <Footer>
                                  <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo>
                         </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="ContactID" Key="ContactID"
                        IsBound="True" Width="75px" Hidden="true"  DataType="System.Int32"
                        AllowResize="Free">
                        <Header Caption="Contact ID">                          
                                  <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                     <igtbl:UltraGridColumn BaseColumnName="DisplayName" Key="DisplayName"
                        IsBound="True" Width="200px"  DataType="System.String" AllowResize="Free">
                        <Header Caption="Contact Display Name">                          
                               <RowLayoutColumnInfo OriginX="10"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                               <RowLayoutColumnInfo OriginX="10"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                     <igtbl:UltraGridColumn BaseColumnName="AssociateID" Key="AssociateID"
                        IsBound="True" Width="75px" Hidden="true"  DataType="System.Int32"
                        AllowResize="Free">
                          <Header Caption="Associate ID">                          
                                  <RowLayoutColumnInfo OriginX="12"></RowLayoutColumnInfo>
                          </Header>
                          <CellStyle Width="200px" Wrap="false"></CellStyle>
                          <Footer>
                                 <RowLayoutColumnInfo OriginX="12"></RowLayoutColumnInfo>
                          </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="DisplayName1" Key="DisplayName1"
                        IsBound="True" Width="250px" Hidden="true"  DataType="System.String"
                        AllowResize="Free">
                        <Header Caption="Associate Display Name">                          
                                <RowLayoutColumnInfo OriginX="11"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                         <Footer>
                                 <RowLayoutColumnInfo OriginX="11"></RowLayoutColumnInfo>
                         </Footer>
                    </igtbl:UltraGridColumn>
                                                            
                    <igtbl:UltraGridColumn BaseColumnName="ProjectCode" Key="ProjectCode"
                        IsBound="True" Width="130px"  DataType="System.String" AllowResize="Free">
                        <Header Caption="Proj./Opp. Code">                          
                                <RowLayoutColumnInfo OriginX="13"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="13"></RowLayoutColumnInfo>
                         </Footer>
                    </igtbl:UltraGridColumn>
                   
                    
                    <igtbl:UltraGridColumn BaseColumnName="BillableActivity" Key="BillableActivity"
                        IsBound="True" Width="53px" Hidden="true"  DataType="System.String"
                        AllowResize="Free">
                        <Header Caption="Billable">                          
                                 <RowLayoutColumnInfo OriginX="14"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="14"></RowLayoutColumnInfo>
                         </Footer>
                    </igtbl:UltraGridColumn>
                   
                     <igtbl:UltraGridColumn BaseColumnName="BillQuantity" Key="BillQuantity"
                        IsBound="True" Width="60px" Hidden="true"  DataType="System.Decimal"
                        AllowResize="Free">
                        <Header Caption="Bill Hours">                          
                                  <RowLayoutColumnInfo OriginX="15"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                                  <RowLayoutColumnInfo OriginX="15"></RowLayoutColumnInfo>
                         </Footer>
                    </igtbl:UltraGridColumn>
                   
                       <igtbl:UltraGridColumn BaseColumnName="UpdatedOn" Key="UpdatedOn"
                        HTMLEncodeContent="false" DataType="System.DateTime" Format="g"
                        IsBound="True" Width="120px" AllowResize="Free">
                        <Header Caption="Updated On">                          
                                <RowLayoutColumnInfo OriginX="23"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                        <Footer>
                                 <RowLayoutColumnInfo OriginX="23"></RowLayoutColumnInfo>
                        </Footer>
                    </igtbl:UltraGridColumn>
                   
                    <igtbl:UltraGridColumn BaseColumnName="Updatedby" Key="Updatedby"
                        HTMLEncodeContent="false"  IsBound="True" Hidden="true" 
                        DataType="System.String" AllowResize="Free">
                        <Header Caption="Updated By">                          
                                 <RowLayoutColumnInfo OriginX="22"></RowLayoutColumnInfo>
                        </Header>
                        <CellStyle Width="200px" Wrap="false"></CellStyle>
                         <Footer>
                                   <RowLayoutColumnInfo OriginX="22"></RowLayoutColumnInfo>
                          </Footer>
                    </igtbl:UltraGridColumn>
                   
                
                </Columns>
               
               <RowTemplateStyle BackColor="Window" BorderColor="Window" BorderStyle="Ridge">
                    <BorderDetails WidthBottom="3px" WidthLeft="3px" WidthRight="3px"
                        WidthTop="3px" />
                </RowTemplateStyle>
                <addnewrow view="NotSet" visible="NotSet">
                </addnewrow>
            </igtbl:UltraGridBand>
        </bands>
        <displaylayout
            allowsortingdefault="Yes"
            headerclickactiondefault="SortMulti" name="UltraWebGrid1"
            stationarymarginsoutlookgroupby="True" version="4.00"
             RowSelectorsDefault="No" SelectTypeRowDefault="Single" TableLayout="Fixed"
             BorderCollapseDefault="Separate">
            <FrameStyle BorderStyle="None" BorderWidth="3px" BorderColor="#999999"
                Cursor="Default">
            </FrameStyle>
            <RowAlternateStyleDefault BackColor="#E9E9F7" Font-Names="Arial">
                <BorderDetails ColorLeft="233, 233, 247" ColorTop="233, 233, 247" />
            </RowAlternateStyleDefault>
            <Pager AllowPaging="True" Alignment="Left">
                <PagerStyle Font-Size="9pt" />
            </Pager>
            <HeaderStyleDefault BackColor="#2B64A7" BorderStyle="Solid" BorderColor="Black"
                ForeColor="White" Font-Size="10pt" Font-Names="Arial">
                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
                    WidthTop="1px" />
            </HeaderStyleDefault>
            <RowStyleDefault BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
                BackColor="White" Font-Size="10pt">
                <Padding Left="3px" />
                <BorderDetails ColorLeft="199, 213, 232" ColorTop="199, 213, 232" />
            </RowStyleDefault>
            <SelectedRowStyleDefault BackColor="#0A75F0" ForeColor="White">
            </SelectedRowStyleDefault>
            <activationobject bordercolor="Black" borderwidth="" BorderStyle="Dotted">
            </activationobject>
            <filteroptionsdefault>
                <filterdropdownstyle backcolor="White" bordercolor="Silver" borderstyle="Solid"
                    borderwidth="1px" customrules="overflow:auto;"
                    font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px"
                    width="200px">
                    <padding left="2px" />
                </filterdropdownstyle>
                <filterhighlightrowstyle backcolor="#151C55" forecolor="White">
                </filterhighlightrowstyle>
                <filteroperanddropdownstyle backcolor="White" bordercolor="Silver"
                    borderstyle="Solid" borderwidth="1px" customrules="overflow:auto;"
                    font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px">
                    <padding left="2px" />
                </filteroperanddropdownstyle>
            </filteroptionsdefault>
        </displaylayout>
    </igtbl:UltraWebGrid>
   </div>
  <asp:SqlDataSource ID="SqlDMC_Main" runat="server"  SelectCommand="SELECT distinct Results_Activities.Completed, Results_Activities.AssignedTo, Results_Activities.ActivityID, Results_Activities.ActivityType, Results_Activities.Priority, Results_Activities.StartDate, Results_Activities.StartTime,  Results_Activities.DurationTotal/60 as TotalHours, Results_Activities.Description, Results_Activities.ContactID, Results_Contacts.DisplayName,  Results_Activities.AssociateID, Results_ContactAssociates.DisplayName, Results_Activities.CategoryCode as ProjectCode,  Results_Activities.BillableActivity, Results_Activities.BillQuantity,  results_Activities.UpdatedOn, results_Activities.Updatedby, Results_Activities.StartDateTime FROM Results_Activities LEFT JOIN  Results_Contacts  ON  Results_Activities.ContactID =  Results_Contacts.ContactID LEFT JOIN  Results_ContactAssociates  ON  Results_Activities.AssociateID = Results_ContactAssociates.AssociateID LEFT JOIN  Lookup_ActivityTypes  ON  Results_Activities.ActivityType = Lookup_ActivityTypes.Code  WHERE ((NOT (Results_Activities.Private = 'Y')) AND (Results_Activities.ContactID IS Null OR Results_Activities.ContactID = 0 OR EXISTS (SELECT Results_Contacts.ContactID FROM Results_Contacts WHERE Results_Contacts.ContactID = Results_Activities.ContactID AND (NOT (Results_Contacts.Private = 'Y')))))">
  </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
 


 

 

 

 

Parents
No Data
Reply
  • 1570
    Offline posted

    My standard grid settings are:

    DisplayLayout 
    AllowColSizingDefault:Free
    AllowColumnMovingDefault:OnServer
    AllowSortingDefault:OnClient (You might want to try OnServer)
    HeaderClickActionDefault:SortSingle
    LoadOnDemand:XML
    RowsRange:50 (How Many Rows The Grid Shows At A Time)
    SeletTypeCellDefault:Single
    SelectTypeRowDefault:Single
    SortingAlgorithmDefault:BubbleSort
    StationaryMargins:Header
    TableLayout:Fixed
    UseFixedHeaders:True
    XMLLoadOnDemand:Virtual

    Behavior:
    Browser:XML

    When I used this method, I was able to turn off paging because of the XmlLoadOnDemand. I played around with some of the different options to get to this configuration. Just ran a quick test and using this setup, my dataset I am returning has 11k rows. This loads and shows the first set of rows in around 2-3 seconds. Since I am also working with a large amount of data, I use a filter row to minimize database hits. Hope this helps.

     

Children