PropertyGrid WinForms Control Easily process properties of data objects, automatically generate and display custom data in C#. Localization of PropertyGrid in C#.NET
KetticPropertyGrid .NET component allows the users to localize this control in your application to display text and message in a specific language. This control is also capable of processing properties of data objects and automatically generates custom editors to display and customize the data for their Windows Forms application. The users of the KetticPropertyGrid control are able to bind the control to a data item with a simple C# code snippet and set the properties as requirements. Localize KetticPropertyGrid Control in C#.NET
The localization of KetticPropertyGrid control can be done by following the steps as below.
- Using the namespace, Kettic.WinForms.UI.Localization, which contains all C# classes for localization of the control
- Create a descendant of PropertyGridLocalizeProvider C# class
- Override the GetLocalizedString() method and provide a translation for the label and user messages.
- The default value will be returned when a translation is not provided
- And then call the base GetLocalizedString method in the default clause of the switch statement.
The C# code example below demonstrates how to create and implement English localization provider.
After finishing the above steps, we shall apply the custom localization provider, instantiate and assign it to the current one. And the C# code below shows how to change the localization provider. PropertyGridLocalizeProvider.CurrentProvider = new MyEnglishPropertyGridLocalizeProvider();
|