Finally i achieved something.
But this code has 1 problem, in the confirmation box, either i click on OK or cancel, it will still proceed to perform the delete operation.
I need, when cancel is clicked, it should not proceed with the delete operation.
finally i got the solution. i will post soon, it will be helpful for others.