Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to change border line color.

Posted on 2011-10-01
7
322 Views
Last Modified: 2012-05-12
Hi, Currently by default the border of datagirdview is white. My question are
1) How do i change the entire border color for my datagridview
2) On selected cell i wants the border to be different color.
0
Comment
Question by:TITO2009
  • 5
  • 2
7 Comments
 
LVL 9

Expert Comment

by:yeelokhk
ID: 36895776
1) You can change it by the properties of DataGridView
http://msdn.microsoft.com/en-us/library/ehz9ksfa.aspx

2) Create a event on SelectedIndexChange, in the eventhandler, get the selected cell and use the cell's property to change the style.
http://stackoverflow.com/questions/404651/how-to-get-a-specific-cell-in-a-datagridview-on-selection-changed
0
 

Author Comment

by:TITO2009
ID: 36895977
Hi solution for no.1, manage to solve. No 2, I get the particular cell index, but did not get property to change border colour.
0
 

Author Comment

by:TITO2009
ID: 36895978
Hi solution for no.1, manage to solve. No 2, I get the particular cell index, but did not get property to change border colour.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:TITO2009
ID: 36895979
Hi solution for no.1, manage to solve. No 2, I get the particular cell index, but did not get property to change border colour.
0
 

Author Comment

by:TITO2009
ID: 36895980
Hi solution for no.1, manage to solve. No 2, I get the particular cell index, but did not get property to change border colour.
0
 
LVL 9

Accepted Solution

by:
yeelokhk earned 500 total points
ID: 36895989
Here is an example from MSDN to adjust individual cell's border
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewadvancedborderstyle.aspx
0
 

Author Closing Comment

by:TITO2009
ID: 36898532
It's help me but still i didn't get what i want. I will post a screen shot on new post.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question