GridView - Edit Record

Discussion in 'ASP .Net' started by shapper, Sep 20, 2007.

  1. shapper

    shapper Guest

    Hello,

    In have a web page layout with various panels.
    One panel contains a GridView and other panel contains various
    TextBox, DropDownList, etc.

    When I click a a GridView row I make visible the Form Panel so that
    the user can edit the data.

    My questions are:
    - How can I fill the form controls with the data of the clicked griv
    view row?
    - And when I submit the form where can I get the ID of the row that
    was clicked?

    Thanks,
    Miguel
     
    shapper, Sep 20, 2007
    #1
    1. Advertising

  2. Howdy,

    Assign gridview.DataKeyNames to "Id" column of your data source. then when
    user selects a row read gridview.SelectedValue to get "Id" being currently
    selected. In addition to that, you can use gridview in conjunction with
    FormView / DetailsView that were invented for such scenarios. There are
    plenty of examples in the internet.
    --
    Milosz


    "shapper" wrote:

    > Hello,
    >
    > In have a web page layout with various panels.
    > One panel contains a GridView and other panel contains various
    > TextBox, DropDownList, etc.
    >
    > When I click a a GridView row I make visible the Form Panel so that
    > the user can edit the data.
    >
    > My questions are:
    > - How can I fill the form controls with the data of the clicked griv
    > view row?
    > - And when I submit the form where can I get the ID of the row that
    > was clicked?
    >
    > Thanks,
    > Miguel
    >
    >
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Sep 20, 2007
    #2
    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. =?Utf-8?B?SnVzdGlu?=

    Retrieving Record Key while creating the record.

    =?Utf-8?B?SnVzdGlu?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    667
    =?Utf-8?B?SnVzdGlu?=
    Oct 5, 2004
  2. =?Utf-8?B?a2Vu?=
    Replies:
    1
    Views:
    10,395
    Wiktor Zychla [C# MVP]
    Jan 23, 2006
  3. André
    Replies:
    0
    Views:
    3,784
    André
    Jun 25, 2006
  4. MRW
    Replies:
    0
    Views:
    400
  5. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    454
    Jaime Stuardo
    Apr 7, 2006
Loading...

Share This Page