GridView - Edit Record

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

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
 
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.
 
Back
Top