面向ASP的Telerik UI。网络核心免费下载30天试用版

本地化

Grid通过利用可用的Resources消息以及提供自定义消息作为其配置的一部分来提供本地化其用户界面的选项。

开始

若要使用社区源资源文件,请覆盖执行上下文并设置服务器端区域性。这导致ASP。网络核心网格to use the matching Resource file messages and localize them accordingly. In case of missing messages, you can update the Resources file or include the message in the configuration of the grid.

  1. 添加Microsoft.AspNetCore.Mvc.Filters系统。全球化到使用命名空间的控制器:

    使用Microsoft.AspNetCore.Mvc.Filters;使用System.Globalization;
  2. 覆盖默认线程区域性和当前UI区域性。

    onactionexecution (ActionExecutingContext) {DefaultThreadCurrentCulture = CultureInfo。DefaultThreadCurrentUICulture = new CultureInfo("fr-FR");base.OnActionExecuting(上下文);}
  3. 匹配客户端文化。通过包含Kendo UI区域性脚本,数字格式、星期和月份名称、日期和时间格式等将与服务器端区域性匹配,并防止验证错误。区域性脚本是从Windows 10和. net 4.7服务器端区域性定义生成的,并根据设计匹配它们。

 @(Html.Kendo().Grid() /*网格定义*/)
  /*网格定义*/ 

工具栏的信息

控件来实现网格中工具栏消息的自定义转换工具栏。[命令]。text ()方法。

@(Html.Kendo(). grid () . toolbar (tools=> {tools. pdf()。文本(“自定义PDF按钮文本”);tools.Excel()。文本(“自定义Excel按钮文本”);tools.Save()。文本(“自定义保存更改按钮文本”);tools.Create()。Text(“自定义创建按钮文本”);})
       

控件来实现网格中列菜单的消息转换ColumnMenu.Messages ()方法。

.ColumnMenu (colMenu = > colMenu。消息(Messages =>{消息。SortAscending("自定义排序消息");消息。sortdescent(“自定义排序消息”);消息。Columns("Custom Columns Message");消息。过滤器(“自定义列过滤器消息”);消息。Lock("Custom Column Lock message"); }) )
 < Column -menu component-type="modern">  < Column -menu-columns-groups> < Column -menu-columns-group title="Order ID" columns='new List {"OrderID"}' /> < Column -menu-columns-group title="Address" columns='new List {"ShipCountry","ShipName", "ShipAddress" }' />    

命令消息

下面的示例演示如何使用命令在网格中实现列命令消息的转换列。[命令]。text ()方法。

. columns (columns => {columns。(f => f. orderid).Width(200);列。Bound(f => f. shipcountry).Width(200);列。命令(Command => {Command . edit())。文本(“自定义编辑按钮文本”);command.Destroy()。Text(“Custom Destroy button Text”);});})
            

过滤消息

下面的示例演示了如何在网格中使用Filterable.Messages ()Filterable.Operators.For[型]()方法。

. filterable (filterable => {filterable。消息(Messages =>{消息。信息(“我的信息”);消息。明确的(“我清楚”);消息。或(“我”);消息。(“我”);消息。itrue ("My Custom True");消息。Operator("my custom operator message"); /* and others */ }); filterable.Operators(op => { op.ForString(strop=> { strop.Clear(); // default filter operator strop.Contains("My Contains"); }); }); })
       

组头消息

下面的示例演示了如何在网格中使用Groupable.Messages.Empty ()方法。

. groupable (groupable=> {groupable。消息(Messages =>{消息。空("My Drag Here to group by column message");});})
    

寻呼消息

下面的示例演示如何在网格中实现寻呼机消息的翻译。有关更多信息,请参阅消息API参考。

.Pageable(pageable=> {pagable . refresh (true);可分页。消息(Messages =>{消息。刷新(“我的刷新”);消息。下一个(“我的未来”);消息。最后(“最后”);消息。显示(“我的{0}-{1}的{2}项”);//{0}是页面上第一个记录的索引,{1}-最后一个记录的索引)/*和其他*/}); })
   @*{0}是页面上第一条记录的索引,{1}是最后一条记录的索引"*@  

另请参阅

在本文中
Baidu
map