2015-12-04 117 views
1

我在Kendo Tabstrip控件中放置了一個局部視圖,並且在那個Tabtrip裏面我有Kendo Grid。Kendo內部的Kendo MVC Grid TabStrip

  @(Html.Kendo().TabStrip() 
       .Name("tabstrip1") 
       .Items(ts => 
         { 
         ts.Add() 
         .Text("Tab Strip 1") 
         .Content(@<text> 
          @(Html.Kendo().Grid<testproject.Class.DiscussionBoard>() 
           .Name("kendogrid1") 
           .Columns(columns => 
            { 
             columns.Bound(p => p.Name).Title("Name"); 
             columns.Bound(p => p.CreatedBy).Title("Created By"); 
             columns.Bound(p => p.Subject).Title("Subject"); 
             columns.Bound(p => p.CommentsDescription).Title("Comments/Description"); 
             columns.Bound(p => p.ModifiedOn).Title("Modified On "); 
            }) 
         .NoRecords("No Recod Exists!!") 
          ) 
         </text>); 
         }) 
     ) 

當我運行此我得到這個錯誤 Error When Kendo MVC Grid is used inside kendo TabStrip

我試圖尋找過網,但沒有發現很多關於這個問題

ASP MVC 5項目

幫助始終讚賞

謝謝

回答

4

使用GridBuilder.ToHtmlString()

.Content(Html.Kendo().Grid<testproject.Class.DiscussionBoard>() 
    .Name("kendogrid1") 
    .Columns(columns => 
    { 
     columns.Bound(p => p.Name).Title("Name"); 
     columns.Bound(p => p.CreatedBy).Title("Created By"); 
     columns.Bound(p => p.Subject).Title("Subject"); 
     columns.Bound(p => p.CommentsDescription).Title("Comments/Description"); 
     columns.Bound(p => p.ModifiedOn).Title("Modified On "); 
    }) 
    .NoRecords("No Recod Exists!!") 
    .ToHtmlString() 
) 
+0

感謝的人:)最後我可以繼續其他工作 – maitiest