Hi -
        I'm trying to get the datagrid to enter edit mode but when I
click on the edit link, it just reposts my page without a datagrid at
all.
        
The control:
<asp:datagrid id="dtgdCart" runat="server" AutoGenerateColumns="false"
border="1" width="450" CellSpacing="0" CellPadding="0"
AlternatingItemStyle-BackColor="#ffcccc" BackColor="#cccccc"
ShowHeader="true" ShowFooter="false" Font-Name="verdana"
Font-Size="11px" oneditcommand="Grid_Edit"
oncancelcommand="Grid_CancelEdit" OnUpdateCommand="Grid_Update">
<Columns>
<asp:BoundColumn DataField="productid" Visible="false" runat="server"
readonly="True" />
<asp:BoundColumn dataField="productname" readonly="True" runat="server"
headertext="Product Ordered" />
<asp:BoundColumn DataField="unitprice" runat="server" readonly="True"
headertext="Unit Price" dataformatstring="{0:c}" />
<asp:BoundColumn DataField="quantity" runat="server"
headertext="Quantity Ordered" readonly="False" />
<asp:EditCommandColumn CancelText="Cancel" runat="server"
EditText="Change" UpdateText="Save Changes" HeaderText="Change
Quantity?"></asp:EditCommandColumn>
</Columns>
</asp:datagrid>

And the subs:

Sub Grid_Edit (Sender as Object, e as DataGridCommandEventArgs)
        dtgdCart.EditItemIndex = e.Item.ItemIndex
        dtgdCart.Databind()
end Sub
                        
Sub Grid_CancelEdit (Sender as Object, e as DataGridCommandEventArgs)
        dtgdCart.EditItemIndex = -1
        dtgdCart.Databind()
end Sub


Any ideas?

I noticed that whenever I re-access the page by adding a new item to the
cart, when I get back to the view cart page (which this is) then the
datagrid is in edit mode.  I need it to go to edit mode when I click the
edit link.

Thank you so much
Matt Small




Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
 





---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to