Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

i want to update whole grid data in a single button click, while doing so,i m just loosing the newly entered data, even though i had put the grid binding code in side(!ispostback).

how can i do it possible ??

thnx in advance
Posted

For this you can use TextBoxes & Labels in every cell of GridView, do it in ItemTemplate.
When you want to edit GridView, display cell data in textboxes, edit it and keep a button for update.
After clicking button, update your gridview and hide all textboxes and display cell data in labels.
Hope this will help you. :)
 
Share this answer
 
You can use Edit, Update, Cancel CommandField.
Read MSDN[^] article for details on how to use it.

dineshmehra1 wrote:
i m just loosing the newly entered data, even though i had put the grid binding code in side(!ispostback)


After you edit a row, you need to rebind the GridView. So call the function which gets data from the database again.
Hope this helps!
 
Share this answer
 
v2
See link below

Link :)
 
Share this answer
 
save the gridview in Session ...........................
 
Share this answer
 

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