Solved

How to change border line color.

Posted on 2011-10-01
7
324 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
[X]
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
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

687 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