GridView - Edit Record

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
 
G

Guest

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.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top