[英]How to show checkbox at the first column of gridview on mousehover
我認為每個人都知道chrome browser
,如果我們選擇“ History
我們將獲得所有瀏覽數據。 當我們將鼠標懸停在特定的行上時,一個check box
是可見的,並且當我們選擇啟用按鈕時,如何執行這種情況
將復選框設置為顯示:無,然后嘗試此操作
protected void RecordsGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","checkbox.style.display='block'");
e.Row.Attributes.Add("onmouseout", "checkbox.style.display='none'");
}
}
@User:您好,您可以使用以下查詢的j查詢使復選框可見,該鏈接在其后高亮顯示行,但是使用相同的基礎,您也可以使復選框可見並單擊按鈕。
http://www.dotnetcurry.com/ShowArticle.aspx?ID=250
http://jquerybyexample.blogspot.com/2011/06/highlight-row-on-mouseover-in-gridview.html
嘗試這個
$(function(){
$("#gridviewname tr").live("hover",function(){
$(this).find("input[id*='chkName']").show();
},
function(){
$(this).find("input[id*='chkName']").hide();
});
$("#gridviewname tr").live("click",function(){
if($(this).find("input[id*='chkName']").attr("checked"))
{
$(this).find("input[id*='chkName']").removeAttr("checked");
$(this).find("input[id*='chkName']").hide();
}
else
{
$(this).find("input[id*='chkName']").attr("checked",true);
$(this).find("input[id*='chkName']").show();
}
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.