Click to See Complete Forum and Search --> : CSS Bound DataGrid [resolved]
MasterBlaster
Sep 23rd, 2003, 01:32 PM
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?
MasterBlaster
Sep 23rd, 2003, 06:13 PM
Never Mind, found it
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";
}
}
CSS Class
/* DataGrid links */
.GridLink:link { color: #666666; text-decoration: none; }
.GridLink:visited { color: #666666; text-decoration: none; }
.GridLink:hover { color: #FF6600; text-decoration: none; }
nswan
Jan 31st, 2004, 08:35 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.