Answered by:
how to make gridview editable in asp.net

Question
-
User193295959 posted
hi friends
I am showing data in gridview. and want user to modify it and click save button. then i will update database by sqldataadapter.update(dt.getchanges)... something like win application.
code like this..
dataTable dt = ds.Table[0]; //ds = dataset
dt = ds.GetChanges();
sqlda.update(dt.GetChanges();
how to make gridview editable??
Thanks for any help...
Monday, June 22, 2009 2:54 PM
Answers
-
User-1635004338 posted
Hi raj_pushkar,
Have a look at this complete example about doing update, delete, insert and select in GridView with code behind (with DataTable):
http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx
Thanks,
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 26, 2009 3:39 AM -
User-1034726716 posted
how to make gridview editable??GridView Insert, Edit, Update and Delete – The Ado.Net way - If using BoundField Columns
Adding Rows in GridView with Edit, Update and Delete Functionality - If using TemplateField Columns
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 26, 2009 5:04 AM
All replies
-
User-1718920064 posted
set autogenerateeditbutton = true, write ur code in the appropriate event.Monday, June 22, 2009 3:19 PM -
Monday, June 22, 2009 3:22 PM
-
User-1635004338 posted
Hi raj_pushkar,
Have a look at this complete example about doing update, delete, insert and select in GridView with code behind (with DataTable):
http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx
Thanks,
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 26, 2009 3:39 AM -
User-1034726716 posted
how to make gridview editable??GridView Insert, Edit, Update and Delete – The Ado.Net way - If using BoundField Columns
Adding Rows in GridView with Edit, Update and Delete Functionality - If using TemplateField Columns
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 26, 2009 5:04 AM -
User-1199946673 posted
Although the others showed ou many examples on how to make the gridciew editable, they only show you the default behavior of the gridview, meaning you can only update 1 record at a time. I'm not sure if that's what you want? If you want to update all records of a gridview and save all changes at once, you should tak a look at:
Friday, June 26, 2009 5:22 AM