telerik:GridBoundColumn 下的文字过长,怎么能隐藏一部分,多余的用省略号代替替

1420人阅读
C# .net(16)
//在导出时直接隐藏不需要导出的列
& protected void btnExcel_Click(object sender, EventArgs e)
&&&&&&& rgProduct.Columns[0].Visible =
&&&&&&& rgProduct.Columns[1].Visible =
&&&&&&& rgProduct.ExportSettings.IgnorePaging =
&&&&&&& rgProduct.ExportSettings.ExportOnlyData =
&&&&&&& rgProduct.ExportSettings.FileName = &ProductManage&;
&&&&&&& rgProduct.MasterTableView.ExportToExcel();
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:18514次
排名:千里之外
原创:25篇
转载:22篇
(1)(1)(3)(2)(1)(2)(1)(1)(1)(1)(3)(5)(1)(3)(8)(13)2088人阅读
When you limit your product's availability to only one language, you limit your potential customer base to a fraction of the world population. If you want your application to reach a global audience, cost-effective
localization of your product is one of the best and most economical ways to reach more customers.
Localization is the translation of application resources into localized versions for the specific cultures that the application supports.
The built-in localization mechanism in Silverlight allows you to localize any string resource used by a standard
RadControl. Once translated you might use your resources in your Silverlight project without changing anything.
The purpose of this tutorial is to show you how to localize any resource string used by a
RadControl.
All examples in this tutorial are demonstrated in the context of the Telerik
RadGridView control. However, the techniques and principles used for the localization of the string resources are valid for all the other Telerik
Silverlight&&&&&& controls.
This topic contains the following sections:
The Telerik.Windows.Controls.LocalizationManager allows you to easily localize any of the Telerik controls.
to your controls just instantiate your custom LocalizationManager and set it to the static property
LocalizationManager.Manager, before the creation of the UI.
LocalizationManager.Manager = new CustomLocalizationManager();
CopyVB.NET
LocalizationManager.Manager = New CustomLocalizationManager()
Note that you have to set the localization manager before the creation of the UI, otherwise some parts might remain not-localized.
Some of the controls are complex user interface controls (e.g. RadGridView,
RadScheduleView) and their strings for localization are numerous. In order to be able to distinguish these resources, an unique identifier called
resource key, is assigned to each localizable string.
On the picture below you can see some resource keys and the strings they are associated with.
For a full list of Resource Keys, check out the Localization topic for the specific control.
&&&&&&&&& The built-in localization mechanism in& Silverlight provides the possibility to set the used Telerik Silverlight controls in one of the following supported languages:
&&&&&&&&&&&&& English&&&&&&&&&&&& &&&&&&&&&&&&& German&&&&&&&&&&&&&& &&&&&&&&&&&&&&& Spanish&&&&&&&&&&&&&& &&&&&&&&&&&&&&& French&&&&&&&&&&&&&& &&&&&&&&&&&&&&& Italian&&&&&&&&&&&&&& &&&&&&&&&&&&&&& Dutch&&&&&&&&&&&&&& &&&&&&&&&&&&&&& Turkish&&&&&&&&&&&&&&
&&&&&&&&& They are located in separate files (each for every language). You can find them in the corresponding folders together with the other binaries in your local installation.&&&&&&&&
&&&&&&&&&&& Not all the controls support each of those languages.&&&&&&&&&&
&&&&&&&&& Note that, the resource folders are supposed to be placed along with the binaries you have referenced.&&&&&&&&
Firstly, you must defined your prefered language in the &Supported Cultures& tag, like so:
The next step for defining the language settings of the application is changing the
Current Culture of the application.&&&&&&&&&&&&
private void Application_Startup(object sender, StartupEventArgs e)
Thread.CurrentThread.CurrentCulture = new CultureInfo(&es&);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(&es&);
this.RootVisual = new MainPage();
CopyVB.NET
Private Sub Application_Startup(sender As Object, e As StartupEventArgs)
Thread.CurrentThread.CurrentCulture = New CultureInfo(&es&)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(&es&)
Me.RootVisual = New MainPage()
&&&&&&&&&&& You could check&&&&&&&&&&&& &&&&&&&&&&& , where you can find detailed explanation about how to achieve this.&&&&&&&&&&
&&&&&&&&& If you want to translate your RadControl in another language, you should use the&&&&&&&&&&
&&&&&&&&& You can base your localization on the standard resource files provided by the .NET framework.&&&&&&&&&& For that purpose you will have to create a separate
.ResX file&&&&&&&&&& for each one of the languages that your application will support.&&&&&&&&
Imagine that you want to translate your control&&&&&&&& (for example:
RadGridView control)&&&&&&&& into English, German and Dutch.&&&&&&&& For that purpose you will have to add three new resource files to your project:&&&&&&&&
GridViewResources.resx - this resource file will store the
English(default)&&&&&&&&&&&& resources for the grid control. Set the
AccessModifier property to Public.&&&&&&&&&& GridViewResources.de.resx - this resource file will store the
German &&&&&&&&&&& resources for the grid control. Set the
AccessModifier property to No code generation.&&&&&&&&&&
GridViewResources.nl.resx - this resource file will store the
Dutch &&&&&&&&&&& resources for the grid control. Set the
AccessModifier property to No code generation.&&&&&&&&&&
Now, having the needed files, it's time to illustrate the idea and localize only the text for the group panel.&&&&&&&& For that purpose you need to create a single resource string in each one of the three resource files and translate it to the appropriate
language.&&&&&&
&&&&&&&&&&& Note that the name of the resource string should be the same as the resource key for the string that you are localizing. The resource key for the group panel is
GridViewGroupPanelText.&&&&&&&&&&
&&&&&&&&& For a full list of Resource Keys, check out the
Localization topic for the specific control.&&&&&&&&
&&&&&&&&& The snapshot below shows the content of the GridViewResources.de.resx file. The resource name of the other two files should be the same. The
Value column will contain the translation for the appropriate language.&&&&&&&&
&&&&&&&&& The last step is to instantiate the LocalizationManager class and set its
ResourceManager to the resources that have been just created (you can do this in the default constructor of the Application class)&&&&&&&&
LocalizationManager.Manager = new LocalizationManager()
ResourceManager = GridViewResources.ResourceManager
CopyVB.NET
LocalizationManager.Manager = New LocalizationManager()
LocalizationManager.Manager.ResourceManager = GridViewResources.ResourceManager
&&&&&&&&&&&&&&& If you rely on culture settings to load the right resources automatically, you have to write some code inside your application's project file.&&&&&&&&&&&&&&& For example, if you have to support English and Dutch languages, you can store the
localized strings in&&&&&&&&&&&&&&&& Resources.resx and
Resources.nl.resx files. For the Resources.resx&&&&&&&&&&&&&&& file you can set
ResXFileCodeGenerator to Internal or Public
&&&&&&&&&&&&&&& and for others - to No code generation. Then, open the project file in a text-mode and insert the code below into the&&&&&&&&&&&&&&&&
&PropertyGroup& section. In this way you notify the framework about the supported cultures.&&&&&&&&&&&&&&
&&&&&&&&&&& The other way to localize your RadControl is to create a class that derives from the
LocalizationManager&&&&&&&&& object and to override its method
GetStringOverride().&&&&&&&&&& The logic is pretty simple, you just have to create a switch statement and return the correct translation for each resource key,&&&&&&&&& as it is shown below:&&&&&&&&
public class CustomLocalizationManager : LocalizationManager
public override string GetStringOverride( string key )
switch( key )
case &GridViewAlwaysVisibleNewRow&:
&&&&&&&&&&&&&&&&&&& return &点击这里添加新项&;
&&&&&&&&&&&&&&& case &GridViewClearFilter&:
&&&&&&&&&&&&&&&&&&& return &清除筛选&;
&&&&&&&&&&&&&&& case &GridViewFilter&:
&&&&&&&&&&&&&&&&&&& return &筛选&;
&&&&&&&&&&&&&&& case &GridViewFilterAnd&:
&&&&&&&&&&&&&&&&&&& return &并且&;
&&&&&&&&&&&&&&& case &GridViewFilterContains&:
&&&&&&&&&&&&&&&&&&& return &包含&;
&&&&&&&&&&&&&&& case &GridViewFilterDoesNotContain&:
&&&&&&&&&&&&&&&&&&& return &不包含于&;
&&&&&&&&&&&&&&& case &GridViewFilterEndsWith&:
&&&&&&&&&&&&&&&&&&& return &结尾等于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsContainedIn&:
&&&&&&&&&&&&&&&&&&& return &包含在&;
&&&&&&&&&&&&&&& case &GridViewFilterIsEqualTo&:
&&&&&&&&&&&&&&&&&&& return &等于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsGreaterThan&:
&&&&&&&&&&&&&&&&&&& return &大于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsGreaterThanOrEqualTo&:
&&&&&&&&&&&&&&&&&&& return &大于等于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsLessThan&:
&&&&&&&&&&&&&&&&&&& return &小于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsLessThanOrEqualTo&:
&&&&&&&&&&&&&&&&&&& return &小于等于&;
&&&&&&&&&&&&&&& case &GridViewFilterIsNotContainedIn&:
&&&&&&&&&&&&&&&&&&& return &不包含在&;
&&&&&&&&&&&&&&& case &GridViewFilterIsNotEqualTo&:
&&&&&&&&&&&&&&&&&&& return &不等于&;
&&&&&&&&&&&&&&& case &GridViewFilterMatchCase&:
&&&&&&&&&&&&&&&&&&& return &区分大小写&;
&&&&&&&&&&&&&&& case &GridViewFilterOr&:
&&&&&&&&&&&&&&&&&&& return &或&;
&&&&&&&&&&&&&&& case &GridViewFilterSelectAll&:
&&&&&&&&&&&&&&&&&&& return &全选&;
&&&&&&&&&&&&&&& case &GridViewFilterShowRowsWithValueThat&:
&&&&&&&&&&&&&&&&&&& return &显示在行中的值&;
&&&&&&&&&&&&&&& case &GridViewFilterStartsWith&:
&&&&&&&&&&&&&&&&&&& return &开头等于&;
&&&&&&&&&&&&&&& case &GridViewGroupPanelText&:
&&&&&&&&&&&&&&&&&&& return &拖拽一列放在这里进行分组&;
&&&&&&&&&&&&&&& case &GridViewGroupPanelTopText&:
&&&&&&&&&&&&&&&&&&& return &组&;
&&&&&&&&&&&&&&& case &GridViewGroupPanelTopTextGrouped&:
&&&&&&&&&&&&&&&&&&& return &分组于&;
return base.GetStringOverride( key );
CopyVB.NET
Public Class CustomLocalizationManager
Inherits LocalizationManager
Public Overrides Function GetStringOverride(key As String) As String
Select Case key
Case &GridViewGroupPanelText&
Return &Zum gruppieren ziehen Sie den Spaltenkopf in diesen Bereich.&
Case &GridViewClearFilter&
Return &Filter l?schen&
Case &GridViewFilterShowRowsWithValueThat&
Return &Anzeigen der Werte mit Bedingung:&
Case &GridViewFilterSelectAll&
Return &Alles anzeigen&
Case &GridViewFilterContains&
Return &Enth?lt&
Case &GridViewFilterEndsWith&
Return &Endet mit&
Case &GridViewFilterIsContainedIn&
Return &Enthalten in&
Case &GridViewFilterIsEqualTo&
Return &Gleich&
Case &GridViewFilterIsGreaterThan&
Return &Gr?sser als &
Case &GridViewFilterIsGreaterThanOrEqualTo&
Return &Gr?sser oder gleich&
Case &GridViewFilterIsLessThan&
Return &Kleiner als&
Case &GridViewFilterIsLessThanOrEqualTo&
Return &Kleiner oder gleich&
Case &GridViewFilterIsNotEqualTo&
Return &Ungleich&
Case &GridViewFilterStartsWith&
Return &Beginnt mit&
Case &GridViewFilterAnd&
Return &Und&
Case &GridViewFilter&
Return &Filter&
End Select
Return MyBase.GetStringOverride(key)
End Function
&&&&&&&&& Of course, if you don't want to hard-code your translation inside your source code, you can always use resource files:&&&&&&&&
public override string GetStringOverride( string key )
switch( key )
case &GridViewClearFilter&:
return GridViewResources.GridViewClearF
return base.GetStringOverride( key );
CopyVB.NET
Public Overloads Overrides Function GetStringOverride(ByVal key As String) As String
Select Case key
Case &GridViewClearFilter&
Return GridViewResources.GridViewClearFilter
End Select
Return MyBase.GetStringOverride(key)
End Function
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:141549次
积分:1497
积分:1497
排名:千里之外
转载:104篇
评论:22条
(5)(2)(4)(5)(4)(2)(11)(13)(5)(9)(14)(2)(17)(2)(6)(8)22942人阅读
技术(19)
CSDN上有一个引路蜂软件的博客,里面有kendo ui的一般用法。它那里讲过的我这里就不再继续重复。
由于框架设计的需要,后台使用spring,前台使用kendo ui构建页面。为了加快快发速度以及底层兼容性,义不容辞的,继续选择了hibernate作为数据库沟通的桥梁。spring方面的例子全网就更多了,主要采用spring注解方式的MVC配置,使用json数据映射器。
& & & & &经过初步的使用,发现kendo ui的设计极为强大,其MVVM的特性与spring的MVC特性结合,配合hibernate开发系统时,如列表呈现之类的,几乎都不需要写什么查询代码。
另外其中文化已经有人托管了文件在GitHub,直接配置后即可使用。对于日期的格式化的问题,经过本人多次尝试,也在汉化文件中通过简单设置,解决全局日期设置问题。
& & & & 下面就来详细介绍一下,如何达到上述效果:
一、中文化
本人的习惯,拿到不管是哪里的控件,第一是看demo炫不炫,代码量如何;第二就是看国际化支持,能不能支持中文语言字典文件之类的汉化,如果不能全局直接设置汉化,而是要逢用必改的话,那就一切免谈。kendo ui是过了我这两关。下面说下具体做法。
去下面这个网址,下载kendo.messages.zh-CN.js文件,就是kendo ui的中文国际化文件。
& & & & /telerik/kendo-ui-core/tree/master/src/messages
内容如下:
/* FlatColorPicker messages */
if (kendo.ui.FlatColorPicker) {
kendo.ui.FlatColorPicker.prototype.options.messages =
$.extend(true, kendo.ui.FlatColorPicker.prototype.options.messages,{
&apply&: &确定&,
&cancel&: &取消&
/* ColorPicker messages */
if (kendo.ui.ColorPicker) {
kendo.ui.ColorPicker.prototype.options.messages =
$.extend(true, kendo.ui.ColorPicker.prototype.options.messages,{
&apply&: &确定&,
&cancel&: &取消&
/* ColumnMenu messages */
if (kendo.ui.ColumnMenu) {
kendo.ui.ColumnMenu.prototype.options.messages =
$.extend(true, kendo.ui.ColumnMenu.prototype.options.messages,{
&sortAscending&: &升序&,
&sortDescending&: &降序&,
&filter&: &过滤&,
&columns&: &列&,
&done&: &完成&,
&settings&: &列设置&,
&lock&: &锁定&,
&unlock&: &解除锁定&
/* Editor messages */
if (kendo.ui.Editor) {
kendo.ui.Editor.prototype.options.messages =
$.extend(true, kendo.ui.Editor.prototype.options.messages,{
&bold&: &粗体&,
&italic&: &斜体&,
&underline&: &下划线&,
&strikethrough&: &删除线&,
&superscript&: &上标&,
&subscript&: &下标&,
&justifyCenter&: &居中&,
&justifyLeft&: &左对齐&,
&justifyRight&: &右对齐&,
&justifyFull&: &两端对齐&,
&insertUnorderedList&: &插入无序列表&,
&insertOrderedList&: &插入有序列表&,
&indent&: &增加缩进&,
&outdent&: &减少缩进&,
&createLink&: &插入链接&,
&unlink&: &移除链接&,
&insertImage&: &插入图片&,
&insertFile&: &插入文件&,
&insertHtml&: &插入 HTML&,
&viewHtml&: &查看 HTML&,
&fontName&: &选择字体&,
&fontNameInherit&: &(继承的字体)&,
&fontSize&: &选择字号&,
&fontSizeInherit&: &(继承的字号)&,
&formatBlock&: &格式化块&,
&formatting&: &格式化&,
&foreColor&: &颜色&,
&backColor&: &背景色&,
&style&: &风格&,
&emptyFolder&: &文件夹为空&,
&uploadFile&: &上传&,
&orderBy&: &排序条件:&,
&orderBySize&: &大小&,
&orderByName&: &名字&,
&invalidFileType&: &选中的文件 \&{0}\& 非法,支持的文件类型为 {1}。&,
&deleteFile&: '您确定要删除 \&{0}\&?',
&overwriteFile&: '当前文件夹已存在文件名为 \&{0}\& 的文件,您确定要覆盖么?',
&directoryNotFound&: &此文件夹未找到&,
&imageWebAddress&: &图片地址&,
&imageAltText&: &替代文本&,
&imageWidth&: &宽度 (px)&,
&imageHeight&: &高度 (px)&,
&fileWebAddress&: &文件地址&,
&fileTitle&: &标题&,
&linkWebAddress&: &链接地址&,
&linkText&: &链接文字&,
&linkToolTip&: &链接提示&,
&linkOpenInNewWindow&: &在新窗口中打开&,
&dialogUpdate&: &上传&,
&dialogInsert&: &插入&,
&dialogButtonSeparator&: &或&,
&dialogCancel&: &取消&,
&createTable&: &创建表格&,
&addColumnLeft&: &左侧添加列&,
&addColumnRight&: &右侧添加列&,
&addRowAbove&: &上方添加行&,
&addRowBelow&: &下方添加行&,
&deleteRow&: &删除行&,
&deleteColumn&: &删除列&
/* FileBrowser messages */
if (kendo.ui.FileBrowser) {
kendo.ui.FileBrowser.prototype.options.messages =
$.extend(true, kendo.ui.FileBrowser.prototype.options.messages,{
&uploadFile&: &上传&,
&orderBy&: &排序条件&,
&orderByName&: &名称&,
&orderBySize&: &大小&,
&directoryNotFound&: &此文件夹未找到&,
&emptyFolder&: &文件夹为空&,
&deleteFile&: '您确定要删除 \&{0}\&?',
&invalidFileType&: &选中的文件 \&{0}\& 非法,支持的文件类型为 {1}。&,
&overwriteFile&: &当前文件夹已存在文件名为 \&{0}\& 的文件,您确定要覆盖么?&,
&dropFilesHere&: &拖拽要上传的文件到此处&,
&search&: &搜索&
/* FilterMenu messages */
if (kendo.ui.FilterMenu) {
kendo.ui.FilterMenu.prototype.options.messages =
$.extend(true, kendo.ui.FilterMenu.prototype.options.messages,{
&info&: &显示符合以下条件的行&,
&isTrue&: &为真&,
&isFalse&: &为假&,
&filter&: &过滤&,
&clear&: &清除&,
&and&: &并且&,
&or&: &或&,
&selectValue&: &-选择-&,
&operator&: &运算符&,
&value&: &值&,
&cancel&: &取消&
/* Filter menu operator messages */
if (kendo.ui.FilterMenu) {
kendo.ui.FilterMenu.prototype.options.operators =
$.extend(true, kendo.ui.FilterMenu.prototype.options.operators,{
&string&: {
&eq&: &等于&,
&neq&: &不等于&,
&startswith&: &开头为&,
&contains&: &包含&,
&doesnotcontain&: &不包含&,
&endswith&: &结尾为&
&number&: {
&eq&: &等于&,
&neq&: &不等于&,
&gte&: &大于等于&,
&gt&: &大于&,
&lte&: &小于等于&,
&lt&: &小于&
&eq&: &等于&,
&neq&: &不等于&,
&gte&: &大于等于&,
&gt&: &大于&,
&lte&: &小于等于&,
&lt&: &小于&
&eq&: &等于&,
&neq&: &不等于&
/* Gantt messages */
if (kendo.ui.Gantt) {
kendo.ui.Gantt.prototype.options.messages =
$.extend(true, kendo.ui.Gantt.prototype.options.messages,{
&views&: {
&day&: &日&,
&week&: &周&,
&month&: &月&
&actions&: {
&append&: &添加任务&,
&addChild&: &添加子任务&,
&insertBefore&: &添加到前面&,
&insertAfter&: &添加到后面&
/* Grid messages */
if (kendo.ui.Grid) {
kendo.ui.Grid.prototype.options.messages =
$.extend(true, kendo.ui.Grid.prototype.options.messages,{
&commands&: {
&cancel&: &取消&,
&canceledit&: &取消&,
&create&: &新增&,
&destroy&: &删除&,
&edit&: &编辑&,
&save&: &保存&,
&select&: &选择&,
&update&: &更新&
&editable&: {
&cancelDelete&: &取消&,
&confirmation&: &确定要删除吗?&,
&confirmDelete&: &删除&
/* Groupable messages */
if (kendo.ui.Groupable) {
kendo.ui.Groupable.prototype.options.messages =
$.extend(true, kendo.ui.Groupable.prototype.options.messages,{
&empty&: &托拽列标题到此处按列组合显示&
/* NumericTextBox messages */
if (kendo.ui.NumericTextBox) {
kendo.ui.NumericTextBox.prototype.options =
$.extend(true, kendo.ui.NumericTextBox.prototype.options,{
&upArrowText&: &增加&,
&downArrowText&: &减少&
/* Pager messages */
if (kendo.ui.Pager) {
kendo.ui.Pager.prototype.options.messages =
$.extend(true, kendo.ui.Pager.prototype.options.messages,{
&display&: &显示条目 {0} - {1} 共 {2}&,
&empty&: &没有可显示的记录。&,
&page&: &页&,
&of&: &共 {0}&,
&itemsPerPage&: &每页&,
&first&: &首页&,
&last&: &末页&,
&next&: &下一页&,
&previous&: &上一页&,
&refresh&: &刷新&,
&morePages&: &更多...&
/* PivotGrid messages */
if (kendo.ui.PivotGrid) {
kendo.ui.PivotGrid.prototype.options.messages =
$.extend(true, kendo.ui.PivotGrid.prototype.options.messages,{
&measureFields&: &拖放数据字段于此&,
&columnFields&: &拖放列字段于此&,
&rowFields&: &拖放行字段于此&
/* RecurrenceEditor messages */
if (kendo.ui.RecurrenceEditor) {
kendo.ui.RecurrenceEditor.prototype.options.messages =
$.extend(true, kendo.ui.RecurrenceEditor.prototype.options.messages,{
&frequencies&: {
&never&: &从不&,
&hourly&: &每小时&,
&daily&: &每天&,
&weekly&: &每周&,
&monthly&: &每月&,
&yearly&: &每年&
&hourly&: {
&repeatEvery&: &重复周期: &,
&interval&: & 小时&
&daily&: {
&repeatEvery&: &重复周期: &,
&interval&: & 天&
&weekly&: {
&interval&: & 周&,
&repeatEvery&: &重复周期: &,
&repeatOn&: &重复于:&
&monthly&: {
&repeatEvery&: &重复周期: &,
&repeatOn&: &重复于:&,
&interval&: & 月&,
&day&: &日期&
&yearly&: {
&repeatEvery&: &重复周期: &,
&repeatOn&: &重复于: &,
&interval&: & 年&,
&of&: & 月份: &
&label&: &截止时间:&,
&mobileLabel&: &截止时间&,
&never&: &从不&,
&after&: &重复 &,
&occurrence&: & 次后&,
&on&: &止于 &
&offsetPositions&: {
&first&: &第一&,
&second&: &第二&,
&third&: &第三&,
&fourth&: &第四&,
&last&: &最后&
&weekdays&: {
&day&: &天&,
&weekday&: &工作日&,
&weekend&: &周末&
/* Scheduler messages */
if (kendo.ui.Scheduler) {
kendo.ui.Scheduler.prototype.options.messages =
$.extend(true, kendo.ui.Scheduler.prototype.options.messages,{
&today&: &今天&,
&save&: &保存&,
&cancel&: &取消&,
&destroy&: &删除&,
&deleteWindowTitle&: &删除事件&,
&ariaSlotLabel&: &选择从 {0:t} 到 {1:t}&,
&ariaEventLabel&: &{0} on {1:D} at {2:t}&,
&views&: {
&day&: &日&,
&week&: &周&,
&workWeek&: &工作日&,
&agenda&: &日程&,
&month&: &月&
&recurrenceMessages&: {
&deleteWindowTitle&: &删除周期条目&,
&deleteWindowOccurrence&: &删除当前事件&,
&deleteWindowSeries&: &删除序列&,
&editWindowTitle&: &修改周期条目&,
&editWindowOccurrence&: &修改当前事件&,
&editWindowSeries&: &修改序列&
&editor&: {
&title&: &标题&,
&start&: &起始&,
&end&: &终止&,
&allDayEvent&: &全天事件&,
&description&: &描述&,
&repeat&: &重复&,
&timezone&: & &,
&startTimezone&: &起始时区&,
&endTimezone&: &终止时区&,
&separateTimezones&: &使用独立的起始和终止时区&,
&timezoneEditorTitle&: &时区&,
&timezoneEditorButton&: &时区&,
&timezoneTitle&: &选择时区&,
&noTimezone&: &无&,
&editorTitle&: &事件&
/* Slider messages */
if (kendo.ui.Slider) {
kendo.ui.Slider.prototype.options =
$.extend(true, kendo.ui.Slider.prototype.options,{
&increaseButtonTitle&: &增加&,
&decreaseButtonTitle&: &减少&
/* TreeView messages */
if (kendo.ui.TreeView) {
kendo.ui.TreeView.prototype.options.messages =
$.extend(true, kendo.ui.TreeView.prototype.options.messages,{
&loading&: &加载中...&,
&requestFailed&: &加载失败&,
&retry&: &重试&
/* Upload messages */
if (kendo.ui.Upload) {
kendo.ui.Upload.prototype.options.localization =
$.extend(true, kendo.ui.Upload.prototype.options.localization,{
&select&: &选择...&,
&cancel&: &取消&,
&retry&: &重试&,
&remove&: &移除&,
&uploadSelectedFiles&: &上传文件&,
&dropFilesHere&: &拖拽要上传的文件到此处&,
&statusUploading&: &上传中&,
&statusUploaded&: &已上传&,
&statusWarning&: &警告&,
&statusFailed&: &失败&,
&headerStatusUploading&: &上传...&,
&headerStatusUploaded&: &完成&
/* Validator messages */
if (kendo.ui.Validator) {
kendo.ui.Validator.prototype.options.messages =
$.extend(true, kendo.ui.Validator.prototype.options.messages,{
&required&: &{0} 为必填项&,
&pattern&: &{0} 非法&,
&min&: &{0} 应该大于或等于 {1}&,
&max&: &{0} 应该小于或等于 {1}&,
&step&: &{0} 非法&,
&email&: &{0} 不是合法的邮件地址&,
&url&: &{0} 不是合法的URL&,
&date&: &{0} 不是合法的日期&
Date.prototype.toISOString = function () {
return kendo.toString(this, &yyyy-MM-dd HH:mm:ss&);
注意最后的这个if(Date),是本人自己加的。主要是为了解决日期控件得到的时间date对象序列化的问题,date对象在向后台通信时,由于后台是spring的MVC框架,所以参数都通过kendo.stringify(XX)方法,或者JSON.stringify(XX)方法进行序列化,会默认调用Date对象的toISOString方法来格式化Date对象。通过在中文化文件中对Date对象的toISOString进行重写,从而达到兼容Spring后台MVC的目的,传递Date对象。格式与spring后台MVC
json视图映射器的Date日期格式一直。这样才能保证Date类型对象,前后台传递没有问题。从gitHub下载的原始文件中不包含此内容。
有了国际化文件,到底怎么用呢?非常简单,直接在页面头部引入即可!
&%@ page language=&java& pageEncoding=&UTF-8&%&
&%@ page contentType=&text/charset=UTF-8&%&
&%@taglib prefix=&c& uri=&/jsp/jstl/core&%&
&!DOCTYPE html &
&meta http-equiv=&Content-Type& content=&text/ charset=utf-8& /&
&link href=&&c:url value='/resources/mon.min.css'/&&
rel=&stylesheet& /&
&link href=&&c:url value='/resources/styles/kendo.rtl.min.css'/&&
rel=&stylesheet& /&
&link href=&&c:url value='/resources/styles/kendo.uniform.min.css'/&&
rel=&stylesheet& /&
&script src=&&c:url value='/resources/js/jquery.min.js' /&&&&/script&
&script src=&&c:url value='/resources/js/kendo.web.min.js' /&&&&/script&
src=&&c:url value='/resources/js/messages/kendo.messages.zh-CN.js' /&&&&/script&
src=&&c:url value='/resources/js/cultures/kendo.culture.zh-CN.min.js' /&&&&/script&
kendo.culture(&zh-CN&);
………………
………………
注意&head&标签的最后3个标签行,kendo.messages.zh-CN.js负责提供所有控件的中文标签信息,使得控件中文化。kendo.culture.zh-CN.min.js里主要是一些日期、货币符号、时间格式、时区等等,不同国家不同的格式配置信息,可以根据需要修改,不过kendo已经提供了中文的文件,不需要我们再做什么操作。
汉化后的Gridview效果,如上述两图所示。效果非常好,并且是全局的,无忧无虑!敬请的使用吧!
再看看日历控件与Gridview的联合使用,并且配置进入Filter过滤器的效果:
& & &中文化就是这么简单!
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:82876次
排名:千里之外
原创:20篇
评论:69条
(1)(1)(1)(4)(5)(1)(1)(1)(8)
QQ即时通讯

我要回帖

更多关于 多余的用省略号代替 的文章

 

随机推荐