用javascript:onclick gridview中的行,使这一行的最后一列radio处于选中状态 或者onclick gridview中的行,使单击的这一行高亮显示 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if (!objbeforeItem) { var objbeforeItem=null; var objbeforeItembackgroundColor=null; } function ItemOver(obj) { if(objbeforeItem) { objbeforeItem.style.backgroundColor = objbeforeItembackgroundColor; } objbeforeItembackgroundColor = obj.style.backgroundColor; objbeforeItem = obj; obj.style.backgroundColor = "#B9D1F3"; } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType==DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "ItemOver(this)");}} 在RowDataBound中以 e.Row.Attributes.Add的方法给行加脚本 CheckBox的判断和颜色改变的控制。 <script> function checkme(obj,tr){ if(obj.checked) tr.style.backgroundColor='blue'; else tr.style.backgroundColor=''; } </script> 后台;if(!IsPostBack) {for(i=0;i<DataGrid1.Items.Count;i++){ radio cb; cb=(radio)DataGrid1.Items[i].FindControl("radio"); DataGrid1.Items[i].Attributes.Add("id","tr" + i.ToString()); cb.Attributes.Add("onclick","checkme(this,tr" + i.ToString() + ");"); }} formview模式切换时显示的问题 很严重的一个问题,不知道该怎么表达才好 急!!! 同个域,不同的语言如何跳转? 安装.net2005时遇到这种问题,请高手帮忙 在一个页面中能不能设置一个用户控件里面一个控件的样式? 如何得到DataGrid中的标题行中的标题? 哪有VS.NET2003中文版的下载啊? 怎样才能将文本区的分段文本插入access数据库? 请问:什么是水晶报表? 今天是情人节? 改变html的lable控件的值 怪问题,进来看看吧
{
var objbeforeItem=null;
var objbeforeItembackgroundColor=null;
}
function ItemOver(obj)
{
if(objbeforeItem)
{
objbeforeItem.style.backgroundColor = objbeforeItembackgroundColor;
}
objbeforeItembackgroundColor = obj.style.backgroundColor;
objbeforeItem = obj;
obj.style.backgroundColor = "#B9D1F3";
} protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType==DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "ItemOver(this)");
}
}
function checkme(obj,tr){
if(obj.checked)
tr.style.backgroundColor='blue';
else
tr.style.backgroundColor='';
}
</script> 后台;
if(!IsPostBack)
{
for(i=0;i<DataGrid1.Items.Count;i++){
radio cb;
cb=(radio)DataGrid1.Items[i].FindControl("radio");
DataGrid1.Items[i].Attributes.Add("id","tr" + i.ToString());
cb.Attributes.Add("onclick","checkme(this,tr" + i.ToString() + ");");
}
}