I am having a performance problem at page load with the Grid.
I have a particular grid (design code below, screen image attached) that loads 1000 records in about 2 seconds. There is no paging, but scrolling is utilized. That seems pretty good to me.
However, when I merge the pages from this particular project into an existing web site, the load time for this very same page, with the very same database connection, and the very same data records, goes to 10 to 12 seconds.
The only difference I can find is that the larger web site has master pages that utilize a standard script manager, not a Telerik script manager.
The display code (.aspx) for the grid is:
There is some code in the code-behind file. That code is:
The screen capture of the grid is attached.
Do you have any suggestions of what I could look at to run down this severe performance change from site to site?
Thanks in advance!
Lynn
I have a particular grid (design code below, screen image attached) that loads 1000 records in about 2 seconds. There is no paging, but scrolling is utilized. That seems pretty good to me.
However, when I merge the pages from this particular project into an existing web site, the load time for this very same page, with the very same database connection, and the very same data records, goes to 10 to 12 seconds.
The only difference I can find is that the larger web site has master pages that utilize a standard script manager, not a Telerik script manager.
The display code (.aspx) for the grid is:
<asp:Panel ID="Panel1" runat="server"> <asp:Panel ID="Panel2" Visible="false" runat="server"> <telerik:RadGrid AutoGenerateColumns="false" ID="SignersGrid" OnItemCommand="SignersGrid_ItemCommand" runat="server" Width="765px" Height="410px" OnItemDataBound="SignersGrid_ItemDataBound" AllowSorting="true" AllowFilteringByColumn="true" AllowPaging="true" PageSize="8" CommandItemDisplay="Bottom" BorderWidth="1px" BorderColor="#999999" EnableEmbeddedSkins="true" Skin="Default" DataSourceID="SQLDataSource1" ShowStatusBar="true" ShowFooter="false" GridLines="None" > <PagerStyle Mode="NextPrevAndNumeric" /> <GroupingSettings CaseSensitive="false" /> <StatusBarSettings ReadyText="Ready" LoadingText="Loading..." /> <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" ShowFooter="True" TableLayout="Auto" DataKeyNames="VoterSignatureId" > <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn HeaderStyle-Width="125px" HeaderText="First Name" UniqueName="FirstName" DataField="FirstName" SortExpression="FirstName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="LastName" HeaderText="Last Name" DataField="LastName" SortExpression="LastName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="350px" UniqueName="VoterAddress" HeaderText="Address" DataField="Address" SortExpression="Address" > </telerik:GridBoundColumn > <telerik:GridButtonColumn HeaderStyle-Width="135px" DataTextFormatString="Remove" ButtonType="PushButton" UniqueName="RemoveSigner" ConfirmText="Are you certain that you want to remove this signature?" Text="Remove" HeaderText="Remove" CommandName="RemoveSigner" CommandArgument="VoterSignatureId" DataTextField="VoterSignatureId" > </telerik:GridButtonColumn> <telerik:GridBoundColumn UniqueName="VoterSignatureId" HeaderText="Id" DataField="VoterSignatureId" Visible="false" > </telerik:GridBoundColumn > </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> </telerik:RadGrid> </asp:Panel></asp:Panel><telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="100px" Width="100px" Transparency="50"><img alt="Loading..." src="ajax-loader.gif" style="border: 0; height: 40px; width: 40px;" /></telerik:RadAjaxLoadingPanel>There is some code in the code-behind file. That code is:
protected void Page_Init(object sender, EventArgs e){ string griddatasource = "SELECT VoterSignatureId, PetitionId, LastName, FirstName, [Address] FROM VoterSignatures "; string gridWHERE = "WHERE VoterSignatureStatusId = 1 AND PetitionId = " + Request.QueryString["PID"]; SqlDataSource1.SelectCommand = griddatasource + gridWHERE;}protected void SignersGrid_ItemCommand(Object source, Telerik.Web.UI.GridCommandEventArgs e){ if (e.CommandName == "RemoveSigner") { // First we need to get the key value of the record the user wants to remove from the lsit Object index = e.CommandArgument; Int16 iSignerRecKey = Convert.ToInt16(index); // Now we can get the record, change it (remove it from the list), and update it ElectronicPetitionSystemDataContext efdc = new ElectronicPetitionSystemDataContext(); VoterSignature vs = efdc.VoterSignatures.Single(vrec => vrec.VoterSignatureId == iSignerRecKey); vs.VoterSignatureStatusId = 2; efdc.SubmitChanges(); this.SignersGrid.Rebind(); }}protected void SignersGrid_ItemDataBound(Object sender, Telerik.Web.UI.GridItemEventArgs e)// { if (e.Item is GridDataItem) { //GridDataItem dataItem = e.Item as GridDataItem; //Button button_Renamed = (Button)dataItem["RemoveSigner"].Controls[0]; //button_Renamed.CommandArgument = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "VoterSignatureId")); //String sMsg = ""; //sMsg = "Are you certain that you want to remove " + Convert.ToString(DataBinder.Eval(e.Item.DataItem, "FirstName")) + "?"; // Telerik example for this is located at: }}protected void SignersGrid_AjaxRequest(Object sender, Telerik.Web.UI.AjaxRequestEventArgs e){ if (e.Argument == "InitialPageLoad") { //System.Threading.Thread.Sleep(1000); this.Panel2.Visible = true; }}The screen capture of the grid is attached.
Do you have any suggestions of what I could look at to run down this severe performance change from site to site?
Thanks in advance!
Lynn