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
Vijaya KadiyalaPosted Jun 30, 2008, 2:32 PM
Hi
Check out the below link
http://forums.asp.net/p/1280468/2445259.aspx
Thanks -- Vj
Prashant VedpathakPosted Jun 30, 2008, 5:12 AM
can u give me a working code example for the above suggested solution.
-- Prashant V
arpit khandelwalPosted Jun 27, 2008, 3:11 AM
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