I have an application that uses the UltraWinGrid all over the place. What I'm trying to do is to customize the "DeleteSingleRowPrompt" and "DeleteMultipleRowsPrompt" messages to be related to the specific grid...for example, if I have trucks in a grid and cars in a grid the delete would say "Do you want to delete this truck" or "Do you want to delete this car" depending on the grid where the action is being performed. If there was only one grid at a time then just setting the string when the form is created would work but there may be multiple windows with multiple grids visible at any instant. Since it appears as though the Infragistics.Win.UltraWinGrid.Resources.Customizer is a single instance for all grids, is there a recommended way to do what I'm trying to accomplish?
You can handle each grid's BeforeRowsDeleted event and display your own dialog, while suppressing the built-in dialog. An example of doing this is provided in the API documentation of the BeforeRowsDeleted event (this link leads to the article in our online help documentation of NetAdvantage for .NET 2008 Volume 3).
Vince,
Neil
Resource customizations apply to the entire assembly to which they're applied. The assembly resource customizer can't use one string for one instance of a control and a different string than another instance of the same control when the string would be displayed in both controls at the same time.
I'm not aware of any way to accomplish this by inheriting from WinGrid and overriding its methods; it may be possible, but it's not approach for which I'd be able to provide much advice.
That's why I suggested handling the grid's BeforeDeleteRows event instead.
Hi Vinary,
You can use the ResourceCustomizer for this. You just assign different text (in whatever language you choose) based on the Current culture. You would typically do this inside the constructor of your main form after the InitializeComponent method is called. Or you could do it even earlier if you like.
Hello Vince,
We would like the message to show differently for each language. Would the Resource Customization help us with that? Or is BeforeDeleteRows my only option?
If Resource Customization is an option, please suggest
Vinay