Click here to Skip to main content
15,940,550 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a grid view and i made it editable, So i have one EDIT button when i clicked update button then, the entire row will be selected in text box.
Now i made some changes in the values populated in the affected row and i click the UPDATE button i want my edited row to save in a temporary datatable. How it can be achieved?

What I have tried:

datatable temp=new datatble();
gridview2 - populated values here.
Updated 9-Aug-18 21:42pm

1 solution

- Create the new datatable.
- Add the relevant columns to the table.
- Create a new datarow and populate its column entries with the new data.
Share this answer
Member 13858616 10-Aug-18 3:53am    
I have added relevent columns same as my Grudview.. But how can i copy the row which is in edit mode to the datatabe?
Richard MacCutchan 10-Aug-18 4:07am    
The same way you would copy it into your text box. For each column in the row take the value and store it in the same position of the new row. A simple for loop.
Member 13858616 10-Aug-18 4:15am    
No i haven't copied it into text box.. Its editing feature of Gridview when its in editmode the data will be converted to textbox.
Member 13858616 10-Aug-18 4:22am    
How can i write the loop for copying the whole row which is in edit mode to the data table.
Richard MacCutchan 10-Aug-18 4:32am    
Use an event handler to capture the end of editing, or similar event, and copy it at that point.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900