Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Painfully slow GridView when using ItemTemplates and EditItemTemplates!

Thread Tools

Painfully slow GridView when using ItemTemplates and EditItemTemplates!

Robert Pettersson
Posts: n/a

I have a old ASP-page Im updating to ASP.Net 2.0. In my old ASP-page I
generated a table, looping through my recordset.
For that amount of rows it was very fast.

Now Im using a GridView to present my result. But the problem is that I
need to be able to edit my rows.
So I created ItemTemplates, CommandField and events to be able to do so. It
works fine on a small resultset, but on a larger resultset it is painfully
So I tried just throwing out a GridView and connecting it to the same
result, with BoundFields. And then its mush faster!

The resultset Im trying to present is 6000 records. And the Gridview with
bound columns take ~40seconds, and the one with ItemTemplates take like 10
And when I press the CommandField (my button) to edit, it takes another 10
minutes to go to edit mode. Why are the postbacks so slow? Do the client
redraw it eveytime? Is the only way not to redraw the whole page to use

The problem is not in the database, the SP Im running takes 1 second to
execute. It is presenting the data on the client!

My old ASP-page was faster the both GridView alternatives!! How can that be?

How do I solve this? Can you not have Editable GridViews in ASP.Net that
have a larger resultset?????

Would be very greateful for any help!!!!

This is part of my 2 Gridviews:

ItemTemplates (really slow!):

<asp:GridView ID="GridViewContribWithdraw" runat="server"
AllowSorting="True" EnableViewState="false"
AutoGenerateColumns="False" AllowPaging="False" PageSize="50"
OnPageIndexChanging="GridViewContribWithdraw_PageI ndexChanging"
OnRowCancelingEdit="GridViewContribWithdraw_RowCan celingEdit"
OnRowUpdating="GridViewContribWithdraw_RowUpdating ">
<asp:TemplateField HeaderText="pkTransactionID"
<asp:Label ID="pkTransactionID" runat="server" Text='<%#
Bind("pkTransactionID") %>'></asp:Label>
<asp:Label ID="LabelpkTransactionID" runat="server"
Text='<%# Eval("pkTransactionID") %>'></asp:Label>
<asp:TemplateField HeaderText="Imported"
<aspropDownList ID="ImportType" AutoPostBack="false"
SelectedValue='<%# Eval("ImportType") %>' runat="server" DataSource='<%#
GetImportTypes() %>' DataTextField="Value" DataValueField="Key">
<asp:Label ID="LabelImported" runat="server" Text='<%#
Eval("ImportTypeName") %>'></asp:Label>
<asp:CommandField ButtonType="Button" ShowEditButton="True">
<ControlStyle CssClass="car-button" />
<PagerSettings Position="TopAndBottom" />

Boundfields (mush faster):

<asp:GridView ID="GridViewContribWithDrawRead" EnableViewState="false"
runat="server" AutoGenerateColumns="False">
<asp:BoundField DataField="ImportTypeName"
<asp:BoundField DataField="PortfolioCode"
<asp:BoundField DataField="OriginID" HeaderText="OriginID"
SortExpression="OriginID" />
<asp:BoundField DataField="TranTypeDescription"


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BufferedImage.TYPE_CUSTOM conversion is painfully slow. emp Java 3 11-24-2005 10:05 PM
event id 256 and painfully slow boot - win2k-sp4 Andreas Perforatus Computer Support 5 01-05-2005 08:09 AM
CiscoWorks painfully slow jw Cisco 4 10-28-2004 07:59 PM
ASP.NET on Server 2003 - Painfully Slow to Process Page? Marc Castrechini ASP .Net 3 07-15-2004 02:21 PM
painfully slow download speeds Susan Brown Computer Support 6 11-16-2003 04:28 PM