我要实现gridview某行被选中时他的背景颜色不是蓝色,怎么实现?
解决方案 »
- asp.net 怎么修改图片的链接地址?
- vs2008视图问题
- vs2005 打开vs2003项目时候提示 生成网站市不是有效的WIN32资源文件
- GriView中隐藏子控件
- vs.net 2005 gridview删除问题
- 如何检测用户操作系统上是否有某种字体 如何有就通过 没有就吧服务器上准备好的字体安装到客户端上
- 页面引入?
- 在bt上面好不容易下了个vs.net2005的正式版,确没有看到什么setup.exe之类,全部是zvs2k5td.r00,zvs2k5td.r01,不知道如何安装?原来装beta2
- 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL
- 关于图片显示
- MSN接口登录,高手帮一下忙
- EXCEL导入数据库
<asp:TemplateField HeaderText="单据编号" >
<ItemTemplate> <asp:Button ID="btnHiddenPostButton" CommandName="HiddenPostButtonCommand" runat="server" Text="" style="display:none" BackColor="Transparent" BorderColor="Transparent" BorderStyle="None" ForeColor="Transparent" />
</ItemTemplate>
<ItemStyle Width="100px" />
</asp:TemplateField>后台RowDataBound方法里控制颜色就行:
protected void gvUserLeave_RowDataBound(object sender, GridViewRowEventArgs e)
{
Button btnHiddenPostButton = e.Row.FindControl("btnHiddenPostButton") as Button; if (btnHiddenPostButton != null)
{
e.Row.Attributes["onclick"] = String.Format("javascript:document.getElementById('{0}').click()", btnHiddenPostButton.ClientID); }
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='purple'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'"); e.Row.Attributes.Add("onclick", "javascrpit:window.open('XXX.aspx?xxx=" + e.Row.Cells[1].Text + "&TaskName=" + e.Row.Cells[2].Text + "')");
}
gridview72般绝技 水清月儿