datagrid question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid were i want to allow the user to select a row then click a
delete button and delete that row. I do not want to have a button in every
row, i want 1 button for the delete. How can i 1. select a row (highlight)
then allow the user to delete the selected row?
 
The direction is like this:

On the server use ItemDataBound event to setup client-side onclick event for
every cell of every data row.

In the client-side javascript event handler change the row visual attributes
to make it look selected.

In the same event handler get the row id from one of the cells and store it
in a client-side variable. You can make the column with id invisible by
setting css rule display:none. Don't set column Visible property to false,
it will result in the column not to be sent to the client.

Make a client-side javascript event handler for the "Delete" button. In the
handler get the selected row id from the variable and put it in a hidden
field on the page. Submit the page.

On the server read the row id from the hidden field and delete the row.

Eliyahu
 
Back
Top