Hello,
is it possible to interact when the user clicks on the "remove" button on the list item in the property grid, in order I can show a confirm "Delete" dialog?
See attached image.
Hello Markus,
You can achieve the requested functionality by attaching an event handler to the xamPropertyGrid's "CommandExecuting" event and handle it the following way:- check if the command is "RemoveListEntry"- perform some additional checking (if necessary)- show the removal confirm dialog- cancel the event if the user does not confirm removal (which will cancel the CommandExecuted event and ultimately cancel the list item removal)
Here is an example on how you may implement it:
private void XamPropertyGrid1_CommandExecuting(object sender, PropertyGridCommandExecutingEventArgs e){ if (e.Command == PropertyGridCommandType.RemoveListEntry) { var result = MessageBox.Show("Are you sure you want to delete?", "Confirm", MessageBoxButton.YesNo); if (result != MessageBoxResult.Yes) { e.Cancel = true; } }}
Let me know if I may be of any further assistance.
Sincerely,Radko KolevSenior Software Developer
Hi all,
In this case, how can we get the value that will be removed from the list?
There is no e.Cancel property!?
I am using v16.1