Webdatagrid column button clickevent
New DiscussionHi everyone,
I hope you can help me with this, I am super new with web developing (I'm a VB.net developer) new to JavaScript and ASP.net, here is my issue, I have a WebDataGrid with four columns:
1- Reference No (Bounded Field from SqlDataSource)
2- Status (Bounded Field from SqlDataSource)
3- TemplateField with a buttom called (Approve)
4- TemplateField with a buttom called (Reject)
so what I want is when I click one of the buttons an SQL command will be fired to update the database, the problem that I couldn't get the column(Reference No) value of the clicked row to execute the query, so I need something like this:
"update Table set status="Approved" where ref_no=(ClickedRowIndex.Cell(Reference No).value)"
thanks in advance,
UPDTAE:
I managed to find a way to get the selected row index and it value, but the problem that I am facing now is when I click the button the selected row doesn't change (doesn't get focused), I have to click on any cell except the button to get a selected row and then I have to click the button, is there any way to set the selected row when the button is clicked?

