Though your question is not clear, I guess you are trying to delete the selected row from database !!!! Its straight forward in a delete button clicked event get the unique key or primary key of the selected row and sent to deleterecord() function:
deleteRecord(int uniqueKey)
{
... where table.id==uniqueKey
}