如何在Telerik MVC 2网格中的同一行显示编辑和删除按钮?

时间:2013-08-08 06:30:01

标签: asp.net-mvc-2 telerik-grid telerik-mvc

我有一个Telerik MVC 2网格,其中有一个包含编辑和删除按钮的命令按钮。但问题是编辑和删除按钮不在同一行(编辑在删除按钮上方,行变得更粗)。我希望“编辑”和“删除”按钮位于同一行,以便行更细。怎么做?谢谢。

这是代码,

...
.Editable(e => e.Mode(GridEditMode.InLine).Enabled(true))
...
columns.Bound(a => a.PersonalCoachId)
.Width(150);
columns.Command(a =>
{
if (Model.Editable)
{
a.Edit().ButtonType(GridButtonType.ImageAndText);
a.Delete().ButtonType(GridButtonType.ImageAndText);
}
})
.Width(95)
.HtmlAttributes(new { style = "float:left;display:inline;" });
...

1 个答案:

答案 0 :(得分:0)

我发现答案非常简单,但非常棘手。只需改为 .HtmlAttributes(new {style =“white-space:nowrap; float:right;”})