Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / January 2007

Tip: Looking for answers? Try searching our database.

DataGridView Cell hi-lighting issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
xanthviper@gmail.com - 31 Jan 2007 15:44 GMT
Hi there,

I'm currently using the DataGridView for some data display on my
windows form.  I'm looking to allow the user to hi-light a specific
row in which they are working on, and then as they move from cell to
cell within that row, the cell selection color changes.  I've been
working on the using the CellPainting Event and trying to create a
rectangle out of the selected cell, and then painting it a different
color, but it doesn't seem to be working out to well. Is this even
really possible?

I'm working with .net 2.0; winforms; C#. I have a couple of events
overridden in which I look for the enter key and have it processed as
if the right arrow key was pressed.  While I don't think this has any
implications, it's just an FYI.

Thank you for your time.

-Xanth
Tim Van Wassenhove - 31 Jan 2007 16:26 GMT
xanthviper@gmail.com schreef:
> Hi there,
>
[quoted text clipped - 6 lines]
> color, but it doesn't seem to be working out to well. Is this even
> really possible?

This seems like the easiest solution to me:

You could handle the CurrentCellChanged event and set the
CurrentCell.Style.BackColor property to the wanted color.
(Also store the currentCell and it's backcolor somewhere, so that on the
next currentcellchagned you can reset the backcolor to it's original value).

Signature

Tim Van Wassenhove <url:http://www.timvw.be/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.