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
There is no e.Cancel property!?
I am using v16.1
Are you sure you are handling the "CommandExecuting" event and not the "CommandExecuted" event ?
I am currently testing with version 16.1.20161.2056 and it looks like this property is present.
I am very glad that you have managed to achieve the functionality you wanted.
Thank you for using Infragistics components.
Thanks!
Now it is working :)