怎么让datalist中符合某一条件下,让这行的背影显示红色呢?
怎么让datalist中符合某一条件下,让这行的背影显示红色呢?急。。在线等 --------------------编程问答-------------------- <SelectedItemStyle BackColor="#FF0000" Font-Bold="False" Font-Italic="False" Font-Overline="False"Font-Strikeout="False" Font-Underline="False" /> --------------------编程问答-------------------- 我是要在DataList1_ItemDataBound事件中判断某一行符合条件的让这行的背景显示红色哦。。 --------------------编程问答-------------------- 哎。。。求助。。 --------------------编程问答-------------------- if (e.Row.RowType == DataControlRowType.DataRow)
{
//鼠标经过时,行背景色变
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#FF0000'");
//鼠标移出时,行背景色变
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
} --------------------编程问答-------------------- 至于 符合 什么条件 你在 if 里面加 --------------------编程问答--------------------
if (js == "True")
{
CheckBox checkjs = (CheckBox)e.Item.FindControl("js");
if (checkjs != null)
{
checkjs.Enabled = false;
}
e.Item.BackColor = System.Drawing.Color.Red;
}
datalist中 <HeaderTemplate>与 <ItemTemplate>必须分成二个表格才可以实现,要是与首模板和item模板,二个用同一个表格就不行了哎。。
如<HeaderTemplate>
<table>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
</table>
</ItemTemplate>
要这样才行。。怎么处理呢
补充:.NET技术 , ASP.NET