Hi,
I have a grid with databound columns, these columns are readonly. I then add a Button column, upon clicking the button, I want one of the data bound columns' value to update. I am guessing I could more easily implement this by having a Select button and doing it that way but for other reasons, the button cannot select the row. I am using this code in the ItemCreated event handler
The event is fired and handled, but in the button click handler, how do I get the row details for the specific row for which the button was clicked? Ie, if I've got 12 rows, and the button was clicked in row 4, how do I know it was the 4th row as it will not be selected?
Thanks,
I have a grid with databound columns, these columns are readonly. I then add a Button column, upon clicking the button, I want one of the data bound columns' value to update. I am guessing I could more easily implement this by having a Select button and doing it that way but for other reasons, the button cannot select the row. I am using this code in the ItemCreated event handler
| if (e.Item is GridDataItem) |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| Button btnProcess = (Button)item["btnProcess"].Controls[0]; |
| if (btnProcess != null) |
| btnProcess.Click +=new EventHandler(btnProcess_Click); |
| } |
The event is fired and handled, but in the button click handler, how do I get the row details for the specific row for which the button was clicked? Ie, if I've got 12 rows, and the button was clicked in row 4, how do I know it was the 4th row as it will not be selected?
Thanks,