Hi,
I have a bound Hyperlink column in an asp.net datagrid. I need to use CSS to control the forecolor and mouse over color of the link. Any Ideas on where to start?
Printable View
Hi,
I have a bound Hyperlink column in an asp.net datagrid. I need to use CSS to control the forecolor and mouse over color of the link. Any Ideas on where to start?
Never Mind, found it
CSS ClassCode:private void DG_mygrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
HyperLink ColLink = (HyperLink)e.Item.Cells[1].Controls[0];
ColLink.CssClass = "GridLink";
}
}
Code:/* DataGrid links */
.GridLink:link { color: #666666; text-decoration: none; }
.GridLink:visited { color: #666666; text-decoration: none; }
.GridLink:hover { color: #FF6600; text-decoration: none; }
sorry for bringing up an old thread but i'm having trouble doing this.
In designer I've set the datagrids class to Topics, and then in the css file i've got
.Topics:link
{
font-family:Arial;
font-size:small;
text-decoration:none;
}
but it won't format my links at all!!!
what am i doing wrong? This is my first attempt at using style sheets and it's proving quite frustrating!
Cheers
Nick