i have a grid view in whichld store i hav aaded a new column 'status'. i hav my data coming frm database. i hav added delete buttons in grid view in eacj row... i want that when i press the del button in order to del a particular row the status column for tht particular row shld be "Invalid "...
or it can be anythng.....my aim is to maintain a status of the deleted row at run time.....is i possible???
plz guys its really urgent......i hav posted one more issue regarding my grid view....plz help.....

4 Years
Discussion Span
Last Post by A0110

Is your gridView databound?"(
Do you have a new field in datatable like "Status", like you have it in grid view?
When you will press a Delete button in gridview, the row will get deleted, but even a field in database must be set to false (or some other value that you (code) will know that row has been deleted, and next time when populating grid view will NOT be shown again).
Thats why you need a new sql SELECT statement like:

"SELECT * FROM MyTable WHERE status = 'false'"

To delete a row, its not a good practice to delete (remove) it straight away, but you have to get a row index (or gridviewrow object) , and delete it afterwards when you are done looping through the rows of grid view. To acomplish that you need (for example) a new list<T>, into which you will or row index or row object.


Hey thnx..... but my issue is somthng diff...i want tht when i press the delete button the row for which i have pressed the button should turn red...i have managed this but the red colour goes off as soon as the page reloads aftr the button is pressed..so i have added a coloumn Status in my grid view which is not there in my database...i want that when i press the button the status column shuld b updatd with a value like true or false so that when the page reloads again i can chk tht value in d rowdatabound event and turn tht particular row red again....
In thos way each time the page reloads tht condition is chkd n those rows gor whoch the del btn is pressed will be shown in red.....this is d whole scenario.....can u please suggest somthng....

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.