By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,724 Members | 1,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,724 IT Pros & Developers. It's quick & easy.

GridView Update/Cancel not working

P: n/a
I am trying a GridView for the first time and it seems to be something
that should be EXTREMELY simple.

I cannot get the Update or Cancel when trying to edit a row to work.

When I click on the Edit link, the row comes up in Edit mode. That's
as far as it goes. If I change a value in a textbox and click Update,
the page reloads still in edit mode but the original values appear in
the textboxes.

Also, the Cancel button does not work either and the row remains in
edit mode after clicking cancel.

Here is my code. It is probably something simple that I am

Any help is appreciated.

<asp:GridView ID="gvEmployees" runat="server"
DataSourceID="odsTemplate" CssClass="DataGrid"
AutoGenerateColumns="False" DataKeyNames="EmployeeID" >
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:CommandField ShowEditButton="True" />

<asp:ObjectDataSource ID="odsTemplate" runat="server"
TypeName="App_BL.TemplateSample" UpdateMethod="UpdateGridView">
<asp:Parameter Name="EmployeeID" Type="Int32" />
<asp:Parameter Name="FirstName" Type="String" />
<asp:Parameter Name="LastName" Type="String" />

Feb 15 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.