currentcell backcolor

G

Guest

Hi,
I have a datagrid & a datatable, and when I use the mousemove event, I run
into trouble.
private void dgMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Windows.Forms.DataGrid.HitTestInfo hitInfo = dg.HitTest(new
Point(e.X, e.Y));
.... // find out which cell is entered
dg.CurrentCell = new DataGridCell(hitInfo.Row,hitInfo.Column);
.... // use tooltip
}
The problem starts when I set dg.CurrentCell. Whatever it's set to, the
backcolor of that cell changes to what looks like some default color (biege),
and the text is highlighted. Also, the MouseUp event doesn't seem to fire, at
least not consistently. I've been trying to figure this one out for a while
now, and am pretty stuck. Anyone know what to do?
Thanks,
Mel
 
K

KJ

You do know that the primary purpose of setting the CurrentCell
property (a struct) is to set focus? That is why it changes color
(takes focus). What is your goal?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top