GridView Update/Cancel not working

Discussion in 'ASP .Net' started by tim.cavins@gmail.com, Feb 15, 2007.

  1. Guest

    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>
    , Feb 15, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vincent
    Replies:
    2
    Views:
    661
    gustmg
    Feb 10, 2009
  2. das

    dropdownlist inside a gridview with Edit,Update,Cancel

    das, Sep 18, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    1,004
  3. Marco Liedekerken
    Replies:
    0
    Views:
    1,038
    Marco Liedekerken
    Nov 8, 2006
  4. datagrid update/cancel command not working

    , Sep 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    699
  5. Gerry Cook

    Gridview - Edit,Update,Cancel doesn't work

    Gerry Cook, Oct 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    429
    Gerry Cook
    Oct 3, 2006
Loading...

Share This Page