Grid Line Deletion


i want to add in validation once click 'Delete' in the Grid/Table but before the line of record remove.

if the validation = 'False', the line of record remine unchange

i have been trying many time but still not able to get 'Delete' onclick function.

Please Help and thank you.