how to do this?

Discussion in 'ASP .Net Datagrid Control' started by Ben, Aug 17, 2006.

  1. Ben

    Ben Guest

    Hi,

    I need the values of the fields of the record that has been selected for
    updating in a gridview.
    In the
    "Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewEditEventArgs) Handles
    GridView1.RowEditing",

    i couldn't find those values ..

    Is this possible, and if yes, how?
    Thanks for help
    Ben
     
    Ben, Aug 17, 2006
    #1
    1. Advertising

  2. What you posted will not give u what i want
    Please post more snippet code
    Patrick
    "Ben" <> wrote in message
    news:...
    > Hi,
    >
    > I need the values of the fields of the record that has been selected for
    > updating in a gridview.
    > In the
    > "Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
    > System.Web.UI.WebControls.GridViewEditEventArgs) Handles
    > GridView1.RowEditing",
    >
    > i couldn't find those values ..
    >
    > Is this possible, and if yes, how?
    > Thanks for help
    > Ben
    >
     
    Patrick.O.Ige, Aug 17, 2006
    #2
    1. Advertising

  3. Ben

    Ben Guest

    Ok, here part of the code:

    1) aspx file:
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConflictDetection="CompareAllValues"
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\my.mdb"
    SelectCommand="SELECT * FROM [lokaal]"
    UpdateCommand="UPDATE [table] SET [field1] = ?, [field2 = WHERE [field1
    = ?">
    <UpdateParameters>
    <asp:parameter Name="field1 Type="String" />
    <asp:parameter Name="field2" Type="String" />

    <asp:parameter Name="original_field1" Type="string" />
    <asp:parameter Name="original_field2" Type="String" />

    </UpdateParameters>
    </asp:SqlDataSource>

    <asp:GridView ID="GridView1" runat="server"
    DataKeyNames="field1" DataSourceID="SqlDataSource1" />
    <Columns>
    <asp:CommandField ShowEditButton="True" >
    <asp:BoundField DataField="field1" />
    <asp:BoundField DataField="field2" />
    </Columns>
    </asp:GridView>

    2) code-behind:
    Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewEditEventArgs) Handles
    GridView1.RowEditing
    ' I want here the code for fetching the original values of the two
    fields ('field1', 'field2') of that record (before updating)
    End Sub


    "Patrick.O.Ige" <> schreef in bericht
    news:e0$dj$...
    > What you posted will not give u what i want
    > Please post more snippet code
    > Patrick
    > "Ben" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I need the values of the fields of the record that has been selected for
    >> updating in a gridview.
    >> In the
    >> "Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
    >> System.Web.UI.WebControls.GridViewEditEventArgs) Handles
    >> GridView1.RowEditing",
    >>
    >> i couldn't find those values ..
    >>
    >> Is this possible, and if yes, how?
    >> Thanks for help
    >> Ben
    >>

    >
    >
     
    Ben, Aug 17, 2006
    #3
  4. Ben

    Ben Guest

    Hallo, Patrick ...

    Can you help me now?
    Thanks
    "Patrick.O.Ige" <> schreef in bericht
    news:e0$dj$...
    > What you posted will not give u what i want
    > Please post more snippet code
    > Patrick
    > "Ben" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I need the values of the fields of the record that has been selected for
    >> updating in a gridview.
    >> In the
    >> "Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As
    >> System.Web.UI.WebControls.GridViewEditEventArgs) Handles
    >> GridView1.RowEditing",
    >>
    >> i couldn't find those values ..
    >>
    >> Is this possible, and if yes, how?
    >> Thanks for help
    >> Ben
    >>

    >
    >
     
    Ben, Aug 18, 2006
    #4
  5. Ben

    Guest

    , Aug 19, 2006
    #5
  6. Ben

    Ben Guest

    Ben, Aug 19, 2006
    #6
    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.

Share This Page