2014-10-20 191 views
-1
@(Html.Kendo().Grid<ModelVM>() 
.Name("ModelVM") 
.HtmlAttributes(new { style = "padding: 0px; margin: 0px;height:100% "  }) 
.ToolBar(toolbar => 
{ 
    toolbar.Custom() 
     .Text("First").HtmlAttributes(new { id = "someid" }) 
     .Action("Index2", "Home"); 
    toolbar.Custom() 
     .Text("Second") 
     .Action("Index2", "Home"); 
    toolbar.Custom() 
     .Text("Third") 
     .Action("Index3", "Home"); 
    toolbar.Custom() 
     .Text("Fourth") 
     .Action("Index4", "Home"); 
    toolbar.Custom() 
     .Text("Fifth") 
     .Action("Index5", "Home"); 
    toolbar.Custom() 
     .Text("Sixth") 
     .Action("Index6", "Home"); 
    . 
    . 
    .  
}) 

我在简单的问题中遇到了问题。对不起,如果它太简单了。 我的问题是我想“第六”自定义工具栏应该在新行。怎么做? 或如何在Kendo-UI工具栏中插入换行符/新行。提前致谢。如何在kendo ui自定义工具栏中添加换行/新行

回答

0

通过使用HTML标记,您可以执行此类操作并应用所需的任何样式。

.ToolBar(toolbar => 
{ 
    toolbar.Template(@<text> 
     <div class="toolbar"> 
      <a href="Index">Index</a> <p> 
      <a href="Index2">Index2</a> <p> 
      <a href="Index3">Index3</a> <p> 
      ... 
     </div> 
    </text>); 
}) 
+0

如果我在第五个元素之后添加此代码。 toolbar.Template(@


);整个工具栏消失。除了我在
内添加的内容。你可以在这里抛出更多的光。无论如何感谢您的帮助。 – 2014-10-21 15:37:53

+0

@SushilGupta,什么? – chiapa 2014-10-21 15:39:50

+0

我的问题是我如何使用toolbar.Template与我提出的问题。如果我在前面的代码中使用toolbar.template。以前的代码不起作用。 – 2014-10-21 15:54:31