简体   繁体   中英

Kendo UI: Localization of the grid through asp.net mvc

Is there any way to set up new message for the Kendo UI Grid from a ASP.NET MVC code ? I'm stuck with a Kendo.Mvc.UI.Fluent.FilterableMessagesBuilder object that I need to pass to the messages method. So what should I pass in the Messages method to change the value ?

@(

Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(col =>
    {
        col.Bound(p => p.Id);
        col.Bound(p => p.FirstName);
        col.Bound(p => p.LastName);
        col.Bound(p => p.Address);
        col.Bound(p => p.Zip);
    })

    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable(filter => filter.Messages(Kendo.Mvc.UI.Fluent.FilterableMessagesBuilder
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
    )
)
     .Filterable(filterable => filterable.Messages(messages =>
         {
             messages.Info("Custom header text"); // sets the text on top of the filter menu
             messages.Filter("CustomFilter"); // sets the text for the "Filter" button
             messages.Clear("CustomClear"); // sets the text for the "Clear" button
         }))

Please look at Kendo Documentation (search for Localization of the filter menu)

Localization of the filter menu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM