Hello all,
I have a datalist. I want to change the background color of row to some other color upon mouse hover. That i have accomplished in Gridview but somehow I m not getting it in datalist. I have done this till now :
protected void dlprod_ItemCreated(object sender, DataListItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
e.Item.Attributes.Add("onmouseover", "this.style.background-color='#ccsdcc'");
e.Item.Attributes.Add("onmouseout", "this.style.background-color='#ffsfff'");
}
}
but its not working. pl provide some tweaks ...
Thanks
Prashant V

arpit khandelwal2 reputationPosted Jun 26, 2008, 11:11 PM EDT
Draw a div in ItemTemplate of datalist mark it with soem id and define classes in css for it.
An alternative is use javascript for mouseover and moseout
Prashant Vedpathak3 reputationPosted Jun 30, 2008, 1:12 AM EDT
can u give me a working code example for the above suggested solution.
-- Prashant V
Vijaya KadiyalaRank #1,085 · 1.8K reputationPosted Jun 30, 2008, 10:32 AM EDT
Hi
Check out the below link
http://forums.asp.net/p/1280468/2445259.aspx
Thanks -- Vj