GridView Update/Cancel not working

T

tim.cavins

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
overlooking...

Any help is appreciated.

Tim


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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top