I had datalist and My manger told me when user select item in datalist this item must have css or color .I did my code but it didnot work well and this error apeared ( Operator ==
cannot be applied to operands of type System.Web.UI.WebControls.ListItemType
and System.Web.UI.WebControls.DataControlRowType
)
protected void DataList3_ItemDataBound(object sender, DataListItemEventArgs e)
{
{
if (e.Item.ItemType == DataControlRowType.DataRow)
{
e.Item.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";
e.Item.Attributes["onmouseout"] = "this.style.textDecoration='none';";
e.Item.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.DataList3, "Select$" + e.Item.ItemIndex);
}
}
}