?
Solved

datagridview change border for one row

Posted on 2010-11-23
6
Medium Priority
?
845 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
[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
6 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 750 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
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!

 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 750 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
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.
Suggested Courses

801 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