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,
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?
I am really sorry I forgot to mention that the problem is happening when I'm using a SqlDataSource as datasource for the WebDataGrid.
I have modified and attached the sample so the WebDataGrid uses SQL data source which connects to the Microsoft's Northwind database. I still cannot reproduce your issue.
Please test it on your side and let me know the result.