为GridView控件的数据行添加鼠标动作
来源:互联网 发布:教学质量监控网络 编辑:程序博客网 时间:2024/06/06 05:52
前台:
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
OnRowCreated="GridView1_RowCreated">
<Columns>
<asp:BoundField DataField="StuID" HeaderText="StuID" SortExpression="StuID" />
<asp:BoundField DataField="Stuname" HeaderText="Stuname" SortExpression="Stuname" />
<asp:BoundField DataField="Stuage" HeaderText="Stuage" SortExpression="Stuage" />
<asp:BoundField DataField="Grade" HeaderText="Grade" SortExpression="Grade" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:DatabindControlsConnectionString %>"
SelectCommand="SELECT [StuID], [Stuname], [Stuage], [Grade] FROM [student]"></asp:SqlDataSource>
</div>
后台:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType ==DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FF0000'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
- 为GridView控件的数据行添加鼠标动作
- 为GridView控件的数据行添加鼠标动作
- GridView控件RowCreated事件的操作——鼠标动作
- 为GridView添加鼠标事件
- 为GridView添加鼠标事件
- GridView鼠标移动到某一行时行发生变色和为Gridview中编辑模板中的控件添加颜色
- Scott Mitchell 的ASP.NET 2.0数据教程之52:为GridView控件添加Checkboxes列
- 为Gridview控件添加多行表头(之一)
- Scott Mitchell 的ASP.NET 2.0数据教程之51章:为GridView控件添加Radio Buttons列
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- 为GridView控件数据字段去掉多余的文字
- 用DataSource控件以外的方法为GridView提供数据
- 安装检测到系统的主 IP 地址是 DHCP 分配的地址
- 年轻人带来的思考
- Ubuntu设置Redhat风格的SHELL提示符PS1属性
- POJ3221
- DirectX Audio and DirectShow to play the music
- 为GridView控件的数据行添加鼠标动作
- 扩展欧几里得算法
- ASM磁盘管理总结
- 结构体与类区别
- CE6 串口打印信息的打开与屏蔽
- 教你申请Google Map密钥的详细步骤
- 如何更换vcs的临时license
- 为GridView控件的数据行添加鼠标动作
- 大端模式与小端模式的区别小解