Solved

datagridview change border for one row

Posted on 2010-11-23
6
835 Views
Last Modified: 2012-05-10
Hi there,
I want to implement the following.

When the user clicks anywhere on a row, i want the borders of the row (OR all top and bottom cell borders and the left border of the first cell and the right border of the last cell) to become red.

Is that possible? Can i have some suggested code please?
Thanks
0
Comment
Question by:ioustinos_sarris
6 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 34203705
0
 

Author Comment

by:ioustinos_sarris
ID: 34207261
I need to change the borders and not the back color.
thanks anyway
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34207300
That was supposed to be an example.
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.

 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 34209653
In order to draw borders in a cell, you can handle the CellPainting event, and draw your own lines, when the cell's RowIndex is the currently selected row.
0
 
LVL 22

Expert Comment

by:Mrunal
ID: 34288550
It will be very easy if you use jQuery.
After datagridview declaration,
write function as-
bind click function to each tr of datagridview table (rendered).
than use addClass("classname");

and declare class name in css file.
write in css definition as:
border:3px;

ref:
http://api.jquery.com/bind/
http://api.jquery.com/addClass/

hope you will get what i mean.
0
 

Author Closing Comment

by:ioustinos_sarris
ID: 34408405
not really what i wanted
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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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, f…

863 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

18 Experts available now in Live!

Get 1:1 Help Now