Telerik UI for WinForms

Optional section title

To localize RadTreeView to display control text and messages in a specific language:

  • All required classes for localization are defined in Telerik.WinControls.UI namespace.
  • Start by creating a descendant of the TreeViewLocalizationProvider class.
  • Override the GetLocalizedString(string id) method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base GetLocalizedString method in the default clause of the switch statement in the example.

Below is a sample implementation of an English localization provider:

[C#] Localizing RadTreeView Strings Copy imageCopy
public class MyEnglishTreeViewLocalizationProvider : TreeViewLocalizationProvider
    public override string GetLocalizedString(string id)
        switch (id)
            case TreeViewStringId.ContextMenuCollapse:
                return "Collapse11";
            case TreeViewStringId.ContextMenuDelete:
                return "Delete11";
            case TreeViewStringId.ContextMenuEdit:
                return "Edit11";
            case TreeViewStringId.ContextMenuExpand:
                return "Expand11";
            case TreeViewStringId.ContextMenuNew:
                return "New11";

        return "";
[VB.NET] Localizing RadTreeView Strings Copy imageCopy
Public Overrides Function GetLocalizedString(ByVal id As String) As String
    Select Case id
        Case TreeViewStringId.ContextMenuCollapse
            Return "Collapse"
        Case TreeViewStringId.ContextMenuDelete
            Return "Delete"
        Case TreeViewStringId.ContextMenuEdit
            Return "Edit"
        Case TreeViewStringId.ContextMenuExpand
            Return "Expand"
        Case TreeViewStringId.ContextMenuNew
            Return "New"
    End Select

    Return String.Empty
End Function

To apply the custom localization provider, instantiate and assign it to the current localization provider:

[C#] Assigning the Current Localization Provider Copy imageCopy
TreeViewLocalizationProvider.CurrentProvider = new MyEnglishTreeViewLocalizationProvider();
[VB.NET] Assigning the Current Localization Provider Copy imageCopy
TreeViewLocalizationProvider.CurrentProvider = New MyEnglishTreeViewLocalizationProvider()

The code provided above illustrates the approach to be used to localize the RadTreeView and is not intended as a full translation.