Hi Mark,
Thanks for your response and the code you provided, so you're using a
custom class collection without using any DataSource control, I think this
should be the cause of the parameters collection in RowUpdating event being
empty. All the parameters are actually associated to the Parameters
declared in DataSource control (the select and update statement in
DataSource control), also we can find some parameter name related attribute
such as
OldValuesParameterFormatString="original_{0}"
So when we do not using DataSource control, there is no info for populating
named parameters .... Thus, we may have to use the original means that
extract the value from GridViewRow's Cell control collection like what we
done in asp.net 1.1 with datagrid...
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| NNTP-Posting-Date: Fri, 20 Jan 2006 09:16:01 -0600
| From: Mark Olbert <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: GridView: Empty OldValues, NewValues
| Date: Fri, 20 Jan 2006 07:16:09 -0800
| Organization: Olbert & McHugh, LLC
| Reply-To: (e-mail address removed)
| Message-ID: <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| X-Newsreader: Forte Agent 3.1/32.783
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Lines: 32
| X-Trace:
sv3-LAZYmdBolYhx+kJpAmoBOGULDT2IaOt8mm0XAdS3/H8Wolx8XkjG2EjqyINMBt07V7vW05b7
BZLOjiS!+eHmPdzx7M/uknFZJOhFDbJ5W5f40+9WyC2ZrYcAVcbqV8rb5BTKgyj724PJ7ARmnbYG
EQ==
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Notifications:
http://www.giganews.com/info/dmca.html
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!news3.google.com!border1.nntp.dca.g
iganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!news.giganews.co
m.POSTED!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372406
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
|
| From the aspx file:
|
| <asp:GridView ID="gridCart" runat="server" AutoGenerateColumns="False"
CellPadding="2" CellSpacing="2" AllowPaging="True"
| EmptyDataText="the cart is empty"
OnPageIndexChanging="gridCart_PageIndexChanging"
OnRowCancelingEdit="gridCart_RowCancelingEdit"
| OnRowDeleting="gridCart_RowDeleting" OnRowEditing="gridCart_RowEditing"
OnRowUpdating="gridCart_RowUpdating">
| <Columns>
| <asp:BoundField DataField="ProductName" HeaderText="Product"
ReadOnly="True" />
| <asp:BoundField DataField="Quantity" HeaderText="Quantity"
DataFormatString="{0:n}" >
| <ItemStyle HorizontalAlign="Right" />
| </asp:BoundField>
| <asp:BoundField DataField="UnitPrice" DataFormatString="{0:c2}"
HeaderText="Unit Price" ReadOnly="True" >
| <ItemStyle HorizontalAlign="Right" />
| </asp:BoundField>
| <asp:BoundField DataField="Price" DataFormatString="{0:C2}"
HeaderText="Price" ReadOnly="True" >
| <ItemStyle HorizontalAlign="Right" />
| </asp:BoundField>
| <asp:CommandField ShowEditButton="True" />
| <asp:CommandField ShowDeleteButton="True" />
| </Columns>
| </asp:GridView>
|
| From the aspx.cs file in Page_Load:
|
| if( !Page.IsPostBack )
| {
| gridCart.DataSource = SiteInfo.Cart;
| gridCart.DataBind();
| }
|
| - Mark
|