Results 1 to 3 of 3

Thread: CSS Bound DataGrid [resolved]

  1. #1

    Thread Starter
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196

    CSS Bound DataGrid [resolved]

    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?
    Last edited by MasterBlaster; Sep 23rd, 2003 at 06:13 PM.
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  2. #2

    Thread Starter
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196

    FYI

    Never Mind, found it
    Code:
    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

    Code:
    /* DataGrid links */
    .GridLink:link { color: #666666; text-decoration: none; }
    .GridLink:visited { color: #666666; text-decoration: none; }
    .GridLink:hover { color: #FF6600; text-decoration: none; }
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    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
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width