Last post Sep 09, 2015 11:13 PM by Fei Han - MSFT
Sep 09, 2015 12:49 PM|mariolopes|LINK
There is my gridview
She is connected to sqldatasource2 with the delete query
DELETE FROM disciplinas WHERE (id = ?)
where parameter ? is defined to gridview1.selectedvalue
The datakeynames on gridview1 is put to id
When I press the delete it doesn't delete the row on gridview. Why?What I'm missing?
I have to select before delete
Sep 09, 2015 12:51 PM|mariolopes|LINK
Sep 09, 2015 11:13 PM|Fei Han - MSFT|LINK
Hi Mario Lopes,
Firstly, I’m glad to hear that you resolve the problem by yourself.
Secondly, we could configure sqldatasource and generate delete statement to enable GridView deleting.
Thirdly, if you’d like to delete the row from code behind, you should find the [id] from the deleting row then delete the record based on the [id] and rebind the GridView.