【问题标题】:Telerik MVC Grid Custom Column Image ButtonTelerik MVC 网格自定义列图像按钮
【发布时间】:2012-07-10 05:12:47
【问题描述】:

我正在使用 Telerik MVC Grid,我正在尝试更改自定义列的按钮图像。

column.Command(Sub(cmd)
                   cmd.Custom("Editar").ButtonType(GridButtonType.BareImage).HtmlAttributes(New With{ .class="btnDelete"}).DataRouteValues(Sub(route)
                                                                                                                         route.Add(Function(x) x.idPedidoDocumentacao).RouteKey("idPedidoDocumentacao")
                                                                                                                     End Sub).Action("DetalhePedido", "Pedido").SendDataKeys(True)
                            End Sub).Width("5%").Title("Editar")

我在我的 css 文件中创建了一个类:

.btnDelete

{

background-position:0px 0px;
background:url(/Images/delete.png);

}

谁能帮我解决这个问题? 谢谢!

【问题讨论】:

    标签: asp.net-mvc model-view-controller telerik grid


    【解决方案1】:

    您需要覆盖按钮使用的背景图片。在 Bare Image 的情况下,它会创建一个像这样的跨度

    <span class="t-icon t-add" />
    

    所以你需要在你的 CSS 样式表上创建一个类

    span.t-icon.t-add{
    background-image: ur('yourimagepath');
    }
    

    请注意 Telerik 在其图标上使用精灵,因此您也需要覆盖背景位置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-12
      • 1970-01-01
      • 2018-02-09
      • 2012-06-17
      • 2017-10-30
      • 2012-05-23
      相关资源
      最近更新 更多