J
Jairo Nieto
Hi i am currently developing a Datagrid that changes background color when
the user rolls over his mouse on a row.
Here's how I handle it:
void dg_menu_ItemDataBound(object sender, DataGridItemEventArgs e)
{ if(e.Item.Cells[2].Text != null && e.Item.Cells[2].Text != " ")
{ e.Item.Cells[3].Attributes.Add("onmouseover",
"this.style.backgroundColor='white'");
e.Item.Cells[3].Attributes.Add("onmouseout",
"this.style.backgroundColor='blue'");
}
}
So far so good. My problem is that i need to asign the cell color to a css
class. i have tried assigning the class directly, changing style for class,
but nothing seems to work. How can i do it?
Thx
the user rolls over his mouse on a row.
Here's how I handle it:
void dg_menu_ItemDataBound(object sender, DataGridItemEventArgs e)
{ if(e.Item.Cells[2].Text != null && e.Item.Cells[2].Text != " ")
{ e.Item.Cells[3].Attributes.Add("onmouseover",
"this.style.backgroundColor='white'");
e.Item.Cells[3].Attributes.Add("onmouseout",
"this.style.backgroundColor='blue'");
}
}
So far so good. My problem is that i need to asign the cell color to a css
class. i have tried assigning the class directly, changing style for class,
but nothing seems to work. How can i do it?
Thx