In this article I will explain how to edit master-detail form using Grid View and Details View control in ASP.NET Download source code Introduction In one of my previous article I explained… Place Link Button Edit in Item Template and Link Button Update and Cancel in Edit Tamplate of Gridview's column. Fire Grid View's Row Editing event for Link Button Edit. Fire Grid View's Row Updating event for Link Button Update. Fire Grid View's Row Canceling Edit event for Link Button Cancel. Set Command Name propery of Link Buttons according to their respective event. Set Grid View's Data Key Names Property to record ID (ID=Primary/Unique key of student table) 7.

in rowupdating event in-1in rowupdating event in-55in rowupdating event in-19

Page { protected void Page_Load(object sender, Event Args e) { //Label1.

User Name; Main Data Load(); } protected void Main Grid View_Row Data Bound(object sender, Grid View Row Event Args e) { //Main Grid View. Connection Strings["Daily Readiness TESTConnection String"].

Text = "AAAA"; } protected void btn Refresh_Click(object sender, Event Args e) { Main Data Load(); } protected void btn Test_Click(object sender, Event Args e) { } protected void Main Data Load() { // declare data reader, contains data for the stored proc Sql Data Reader dr Grid Data; //define connection Sql Connection con = new Sql Connection(Web Configuration Manager. Open(); Sql Command cmd = new Sql Command("SP_Session Details Load", con); cmd. Execute Reader(); //make sure there's data there before assigning it if (dr Grid Data.

HTML CODE: C# Code Behind: private void Bind Data() { Sql Connection my Connection = new Sql Connection("Server=localhost; Database=Northwind; Trusted_Connection=true"); Sql Data Adapter ad = new Sql Data Adapter("SELECT * FROM Categories", my Connection); Data Set ds = new Data Set(); ad.

Text; // Now send the values to the databae and update it!

Find Control("txt Category Description") as Text Box).

Data; namespace Daily Readiness { public partial class Web Form1 : System.

When the user clicks EDIT then makes a change or two, then UPDATE, the changes are lost. Also, my code below works pretty well, I even have the framework worked out to get my data values from the gridview.

I did some google searches, and there were examples out there but it just isn't making sense. Hi, I would first suggest that you use the Template Columns instead of the Bound Columns this way you are not dependent on the index/position of the column in the Grid View. the problem is still saving the edits done by the user to the gridview in edit mode.