Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete confirmation before deleting a datagrid row in wpf C# [closed]

Tags:

c#

wpf

How to create a dialog window or something similar to confirm a delete action before deleting a datagrid row?

like image 626
Tinaira Avatar asked Oct 31 '22 15:10

Tinaira


1 Answers

In WPF there are "preview" events that get called before the "standard" event gets called. These events have the word Preview prefixed on the event name (i.e. PreviewMouseDown). In the "preview" event you can display a MessageBox, or something similar, asking the user to confirm the deletion. If the user confirms the deletion let the event continue. Otherwise you can mark the event as handled and the "standard" event will not execute.

like image 103
Phillip Avatar answered Nov 15 '22 04:11

Phillip