worst scam dating sites - Gridview rowupdating neweditindex

aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.

gridview rowupdating neweditindex-30

When I click edit on the grid and change the value of the textbox and click update the label will just display the original value of the textbox. "When I click edit on the grid and change the value of the textbox and click update the label will just display the original value of the textbox." So lets say there is "test" in the textbox originally and then I edit it to "asd" then click update.

When I click on the edit button the update and cancel button appear.

To get the Primary Key reference we can use the Data Keys collection of the Grid View.

This collection only requires the row index no and it will give us the primary key.

You didn't ask this in your question, but you've written some smelly code here.

I'll try to address your question, but I'm also going through some of the other problems here.

If user clicks the Cancel button while Grid View is in editing mode, you need to Cancel the Editing process and also need to reset the Edit Index property to -1 in the Row Canceling Edit event of the Grid View control as shown below: The last step is to handle the Row Updating event to actually update the back end database.

To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.

Now I will show you the C# code behind file of the above ASP.

Tags: , ,