不会吧,我写代码的时候,C#在后边自动显示的方法属性之类的,根本就没有HitTestInfo,我真是气晕了,是不是我没装beta2的缘故啊,最可怕的是我根本就不知道我现在安装的VS有没有装BETA2,盗版货啊

解决方案 »

  1.   

    我也是这样,显示不出来,
     DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt); 
    你照怎么写,运行肯定没错! 
       
      

  2.   

    我本来是打算双击datagrid时(检测是不是在cell中双击),用messagebox来显示当前光标所在格的值,可是我怎么双击都没有反应,只是选择该格的字符串
    代码如下:
    System.Drawing.Point pt = dataGrid1.PointToClient(Cursor.Position);  
    DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
    if(hti.Type==DataGrid.HitTestType.Cell)

     MessageBox.Show(this.dataGrid1.CurrentCell.ColumnNumber.ToString()); 
    MessageBox.Show(this.dataGrid1.CurrentCell.RowNumber.ToString()); 
    }
      

  3.   

    好象cell中双击触发不了,要点datagrid的rowcolumn或headcolumn
      

  4.   

    哦,我知道了,cell双击解决不了啊?我才十分也不给谁了