2012-11-12 64 views
2

我在我的cshtml中有Telerik Grid,它在Telerik Grid中有兩個自定義列命令。現在自定義命令呈現爲按鈕,我希望它們顯示爲鏈接而不是按鈕。是否有可能?如何實現它?自定義命令作爲LinkBut​​ton而不是Telerik Grid中的按鈕ASP.NET MVC

自定義列命令代碼如下

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)); 

回答

0

命令「按鈕」是在引擎蓋下的鏈接。只需覆蓋主題所應用的CSS,您將獲得一個真正的鏈接。

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

也許你將不得不添加額外的屬性來覆蓋。

0

使用命令按鈕的HtmlAttributes來設置按鈕的樣式。事實上,設置background:none會暴露該按鈕確實是超鏈接。

相關問題