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/>