The grid DeleteSelectedRows method provides an option to display a prompt dialog to the user. Since the method does not return any value, is there any other way to determine if the user clicked on the "No" button.
Hi Neil,
One thing you could do is trap AfterRowsDeleted. It will only fire if the user did not cancel.So if it doesn't fire, you know the user cancelled.
If you need more control than that, I suggest you handle the BeforeRowsDeleted event and cancel the default prompt by setting e.DisplayPromptMsg. Then you can display your own MessageBox and you will know the result. If the user cancels your dialog, you just set e.Cancel to true.
Hi Mike
We need to the default delete prompt to show in the user's language. Is there some way to make it show as per the ".NET culture" setting? i.e. the app when run in a Japanese .NET culture would display the prompt in Japanese?
Ideally I would like to avoid implementing my own message box and use something like Infragistics.Shared.ResourceCustomizer to make this happen .
Thanks!
Hi,
These dialog strings are localizable via the ResourceCustomizer.
In the UltraWinGrid assembly, the string you will need are:
vrn said: 1. I guess my translated string would use the .Net String Format notation like "You are about to delete {0} rows" and the {0} would be replaced at run time?
1. I guess my translated string would use the .Net String Format notation like
"You are about to delete {0} rows" and the {0} would be replaced at run time?
Yes, that's correct. If you take a look at the original strings (which are documented in the help) you will see that the default strings have a replacement code "{0}" in them. So that's a good indication that you need to do the same thing when you replace the string with one of your own.
vrn said:2. How about the button labels? Yes, No, etc
The dialog being displayed here is a MessageBox. So I don't beleive there is any way to localize these. But there should be no need to. I'm pretty sure Microsoft already does this for you based on the current culture.
Terrific! The message has a dynamic piece to it. something like "You are about to delete 5 rows".
Question
2. How about the button labels? Yes, No, etc