New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Localization

 Category IDPriceIn stockParent Category ID
123
Page:
of 3Page size:
A  
  A1$6.79A
 
  A2$9.49A
B  
  B1$6.49B
  • Demo Configurator
Choose language

This demo shows how to localize RadTreeList using global resource files. You just need to copy the default resource RadTreeList.Main.resx file to the App_GlobalResouces folder and rename the copy so that it contains the Culture Identifier.

Note that the data editing operations are not implemented in this demo. The edit functionality is added to illustrate how the RadTreeList command buttons text and tooltips are localized through global resource.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" Inherits="Telerik.TreeListExamplesCSharp.Localization.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeList1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeList1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="ConfiguratorPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ConfiguratorPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeList1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="ConfiguratorPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
          <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server"  EnableRoundedCorners="false" DecoratedControls="All"  DecorationZoneID="decorated-zone" />
         <div class="demo-container" id="decorated-zone">
        <telerik:RadTreeList RenderMode="Lightweight" ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource" ParentDataKeyNames="ParentID"
            AllowSorting="true" DataKeyNames="ID" AllowPaging="true" PageSize="5" AutoGenerateColumns="false" Width="780px">
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
            <Columns>
                <telerik:TreeListEditCommandColumn UniqueName="EditCommandColumn" ButtonType="FontIconButton" ShowAddButton="false" HeaderStyle-Width="210px">
                </telerik:TreeListEditCommandColumn>
                <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Category ID" ReadOnly="true"></telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="Price" UniqueName="Price" DataFormatString="{0:C}" HeaderText="Price">
                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                </telerik:TreeListBoundColumn>
                <telerik:TreeListCheckBoxColumn DataField="InStock" UniqueName="InStock" HeaderText="In stock">
                    <HeaderStyle Width="70px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </telerik:TreeListCheckBoxColumn>
                <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="Parent Category ID"
                    ReadOnly="true">
                </telerik:TreeListBoundColumn>
                <telerik:TreeListEditCommandColumn UniqueName="EditCommandColumn" ButtonType="FontIconButton" ShowAddButton="true"
                    ShowEditButton="false">
                    <HeaderStyle Width="40px"></HeaderStyle>
                </telerik:TreeListEditCommandColumn>
            </Columns>
        </telerik:RadTreeList>
                </div>
    <qsf:ConfiguratorPanel ID="ConfiguratorPanel1" runat="server">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Narrow" Title="Choose language">
                    <qsf:RadioButtonList ID="radiobuttonlistLanguages" runat="server" RepeatDirection="Vertical"
                        AutoPostBack="True" Style="margin-left: 1em" OnSelectedIndexChanged="radiobuttonlistLanguages_SelectedIndexChanged">
                        <asp:ListItem Value="en-US" Selected="true"><img src="images/en-US.gif" alt="English" /> English</asp:ListItem>
                        <asp:ListItem Value="bg-BG"><img src="images/bg-BG.gif" alt="Bulgarian" /> Bulgarian</asp:ListItem>
                    </qsf:RadioButtonList>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>

    </form>
</body>
</html>

Support & Learning Resources

Find Assistance