private void Grid1_CurrentCellChanged(object sender, System.EventArgs e)
{
int tpRowNum = Grid1.CurrentCell.RowNumber;
RowNum=-1;//解决一行数据选择问题
if(tpRowNum!=RowNum)
{

RowNum =tpRowNum;
}
//实现行选
Grid1.CurrentRowIndex=RowNum;
Grid1.Select(RowNum);
}

解决方案 »

  1.   

    private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
      this.dataGrid1.Select(this.dataGrid1.CurrentRowIndex);
    }
      

  2.   

    dataGrid,本来就是烂,....鄙视我没有,我只不过就是用用,不好用就是烂了,我也没说你烂,你急什么,呵
      

  3.   

    事件可以使用好多个,这里选择MouseUp
    private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    Point pt = new Point(e.X,e.Y);
    DataGrid.HitTestInfo hit = dataGrid1.HitTest(pt);
    if(hit.Type == DataGrid.HitTestType.Cell) 
    {
    dataGrid1.Select(hit.Row); 
    }
    }
      

  4.   

    更多的问题可以看这里,
    http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp