gridView的数据源是个DataTable的实例,
gridView的第一列为linkbutton,
我的问题是,我需要根据不同的情况,使部分linkbutton没有超链接的下划线,而且文字还要是正常显示的。
我该怎么做呢?我要问的一个是:分情况判定的时候,除了遍历整个Dt之外有没有其他的方法?
另一个是:怎么把linkbutton的下划线去掉,还要正常显示文本?谢谢!
gridView的第一列为linkbutton,
我的问题是,我需要根据不同的情况,使部分linkbutton没有超链接的下划线,而且文字还要是正常显示的。
我该怎么做呢?我要问的一个是:分情况判定的时候,除了遍历整个Dt之外有没有其他的方法?
另一个是:怎么把linkbutton的下划线去掉,还要正常显示文本?谢谢!
解决方案 »
- 怎么下载 txt文件 而不是在浏览器中打开
- 从文本框向access中插入数值问题
- DetailsView中单击删除按钮,如何让它出现两次确认?
- 如何在HTML里像动态页面一样include调用别的页面进到此HTML页面?
- 菜鸟问题 这里为什么出错了
- 如何给GridView绑定列添加默认值
- |G|flash8 想在图上加个透明的东西,一点击能触发事件,用什么?
- 用Response.BinaryWrite()从sqlserver里读出图片,显示到叶面,如何定位图片位置。
- 用过zedgraph的看过来
- 在.net中如何实现数据类型的转换?
- 在asp.net中怎样跳转框架
- ASP.NET连接sql server登录失败
#region 绑定行事件
/// <summary>
/// 绑定行事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void GvList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex != -1)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#eef7fe'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
}
int id = e.Row.RowIndex + 1;
e.Row.Cells[0].Text = id.ToString(); if (e.Row.Cells[5].Controls.Count != 0)
{
((LinkButton)e.Row.Cells[5].Controls[0]).Attributes.Add("onclick", "return confirm('确定删除此条纪录吗?')");
}
if (e.Row.Cells[4].Controls.Count > 1)
{
((LinkButton)e.Row.Cells[4].Controls[0]).Attributes.Add("onclick", "return confirm('确定更新此条纪录吗?')");
}
}
}
#endregion
研究一下上面的代码自己该一下样式就可以了