Solved

datagridview change border for one row

Posted on 2010-11-23
6
841 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 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
MS Dynamics Made Instantly Simpler

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

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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