CellHover, not datagrid MouseHover?

G

Guest

Hi,
I've used the MouseHover event in my datagrid and have almost everything the
way I want it - but I've realized that the MouseHover event won't go unless
the mouse leaves the datagrid. But I need it to kick in when I move the
mouse over a different cell within the datagrid.
I don't even know where to start here. Any recommendations?
Thanks!!!
Mel
 
S

Sanjeevakumar Hiremath

Try this code it might be helpful to you.

private DataGrid.HitTestInfo hti;
private void dataGrid1_MouseHover(object sender, System.EventArgs e)
{
if ( hti.Type == System.Windows.Forms.DataGrid.HitTestType.Cell )
{
this.textBox1.Text = dataGrid1[hti.Row, hti.Column].ToString();
}
}

private void dataGrid1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
hti = dataGrid1.HitTest(e.X, e.Y);
}

Regards,
Sanjeevakumar Hiremath
Proteans Software Solutions


http://msdn.microsoft.com/library/d...windowsformsdatagridhittestinfoclasstopic.asp
 

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