【问题标题】:Custom Command as LinkButton instead of Button in Telerik Grid ASP.NET MVCTelerik Grid ASP.NET MVC 中的自定义命令作为 LinkBut​​ton 而不是 Button
【发布时间】:2012-10-31 16:41:07
【问题描述】:

我的 cshtml 中有 Telerik Grid,它在 Telerik Grid 中有两个自定义列命令。现在自定义命令呈现为按钮,我希望它们显示为链接而不是按钮。这可能吗?如何实现?

自定义列命令代码如下

    columns.Command(commands => commands
        .Custom("Edit")
        .Text("Edit")
        .SendState(false)
        .DataRouteValues(route =>

     {

route.Add(o => o.SuppliersInvoiceNumber).RouteKey("InvoiceNumber");

    })

    .Ajax(true));


    columns.Command(commands => commands

    .Custom("remove")

    .Text("Delete")

    .SendState(false)

    .DataRouteValues(route =>

     {

route.Add(o => o.PONumber).RouteKey("PONumber");

     })

     .Ajax(true));

【问题讨论】:

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


    【解决方案1】:

    使用命令按钮的HtmlAttributes 设置按钮样式。事实上,设置background:none 会暴露按钮确实是一个超链接。

    【讨论】:

      【解决方案2】:

      命令“按钮”是引擎盖下的链接。只需覆盖主题应用的 css 即可获得真正的链接。

      .t-button {
         border: 0 none transparent;
         min-width: 0;
         border-radius: 0; 
         margin: 0;
         background:none;
         background-color:transparent;
      }
      

      也许你必须添加额外的属性来覆盖。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-02-16
        • 1970-01-01
        • 2013-05-07
        • 1970-01-01
        • 2011-10-12
        • 1970-01-01
        • 1970-01-01
        • 2015-02-18
        相关资源
        最近更新 更多