2013-04-24 68 views
0

有什麼方法可以從ASP.NET MVC代碼爲Kendo UI Grid設置新消息嗎?我堅持使用Kendo.Mvc.UI.Fluent.FilterableMessagesBuilder對象,我需要傳遞給消息方法。 那麼我應該通過Messages方法來更改值?Kendo UI:通過asp.net進行網格本地化mvc

@(

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) 
    ) 
) 

回答

1
 .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 
     })) 

請看看劍道的文檔(搜索過濾器菜單的本地化)

Localization of the filter menu

+0

謝謝,我看過的文檔,但沒有用於ASP.NET CSHTML沒有例子編碼風格。 – 2013-04-25 09:41:52