Are you calling the Static HitTestInfo? Try this C# code:
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
if(hti.Type == DataGrid.HitTestType.Cell)
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}
>Cathi...
>
>Thanks for your response.
>
>I'm using C#, so I tried to convert it. However, I must be missing something, because I'm not able to access things like HITTESTINFO. I even tried a code sample from MSDN that was written for .NET, but the code that I paste in doesn't even run. (Even typing 'System.Windows.Forms.DataGrid.HitTestInfo myhit results in an error).
>
>Kevin
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi