Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView Update/Cancel not working

Thread Tools

GridView Update/Cancel not working
Posts: 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">
<asparameter Name="EmployeeID" Type="Int32" />
<asparameter Name="FirstName" Type="String" />
<asparameter Name="LastName" Type="String" />

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
GridView's Paging feature not working! ASP .Net 3 05-12-2007 12:12 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
DataFormatString not working in GridView Alan Silver ASP .Net 12 03-10-2006 11:06 PM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
August CTP DataFormatString in Gridview not working Gerhard Pretorius ASP .Net 3 09-22-2005 06:40 AM