DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: DataGridViewLinkColumn SelectionBackColor and SelectionForeColor not taking effect.

  1. #1
    Join Date
    Mar 2009
    Posts
    67

    Question DataGridViewLinkColumn SelectionBackColor and SelectionForeColor not taking effect.

    Setting the SelectionBackColor and SelectionForeColor of a DataGridViewLinkColumn from the design IDE doesn't take effect. The cell texts still hold the default color blue. Why is this happening? Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    Longueuil, Québec
    Posts
    577
    These properties do not apply to the column, they apply to the grid and how it behave when the user select a row.

    The properties that you are looking for are LinkColor, ActiveLinkColor and VisitedLinkColor. You do not set them on the grid, but on the column itself, throug the Columns property of the Grid.
    Jacques Bourgeois
    JBFI
    http://www3.sympatico.ca/jbfi/homeus.htm

  3. #3
    Join Date
    Mar 2009
    Posts
    67

    Question DataGridViewLinkColumn SelectionBackColor and SelectionForeColor not taking effect.

    Quote Originally Posted by JBourgeois View Post
    These properties do not apply to the column, they apply to the grid and how it behave when the user select a row.
    Do u mean these properties don't apply to DataGridViewLinkColumn only or just any column? Because, through the design IDE, u can set those properties to other column types of a datagridview. Go to the properties explorer, click the button beside the Columns property, the window for defining individual column properties opens up, select any column from the left panel and click the button beside the DefaulCellStyle property in the right panel. The DefaultCellStyle window pops up. Here u can set the cell style for that particular column explicitly.
    I tried this way but it doesn't work for DataGridViewLinkColumn. Don't know why? May be it's getting overriden by the inherited style.

  4. #4
    Join Date
    Feb 2004
    Location
    Longueuil, Québec
    Posts
    577
    The other type of columns use those properties to define what happen when you select them.

    LinkColumn are a special case, because the link itself already has a choice of colors (LinkColor, ActiveLinkColor and VisitedLinkColor). There could be a conflict between one of those and the Selection colors, so the Selection colors do not work on that type of column.

    If you want to have a color other than blue, you need to change the LinkColor.
    Jacques Bourgeois
    JBFI
    http://www3.sympatico.ca/jbfi/homeus.htm

  5. #5
    Join Date
    Mar 2009
    Posts
    67

    Thumbs up

    Yeah, i kind of hoped of that too. It's a relief that nothing ain't wrong from my side. Thanks.

Similar Threads

  1. BT changes not taking effect
    By jheywood in forum .NET
    Replies: 0
    Last Post: 01-22-2009, 11:06 AM
  2. Sql Query is taking forever
    By Matrix.net in forum Database
    Replies: 0
    Last Post: 03-27-2007, 03:22 PM
  3. Strange date effect
    By DaveMere in forum Java
    Replies: 2
    Last Post: 05-11-2005, 11:45 AM
  4. Recordcount taking too long
    By Eqbal in forum ASP.NET
    Replies: 1
    Last Post: 08-02-2002, 08:58 AM
  5. writing to registry: No error, but also no effect
    By Johnny Knoxville in forum VB Classic
    Replies: 0
    Last Post: 05-13-2002, 06:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center