Solved

How to change border line color.

Posted on 2011-10-01
7
320 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

15 Experts available now in Live!

Get 1:1 Help Now