Solved

How to change border line color.

Posted on 2011-10-01
7
318 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now