在datagridview中怎么样让某一行某一列处于编辑状态。并把光标也设置到此行此列上

解决方案 »

  1.   

    ....Focus();不知这个是否可行
    i am also newer
      

  2.   

    DATAGRIDVIEW里面是数据库的内容吧
    好像不能编辑的吧
      

  3.   

    调用如下方法就可以啦
    DataGridView1.CurrentCell=DataGridView1.Rows(x).Cells(y);
      

  4.   

    private void dataGridView1_MouseUp(object sender, MouseEventArgs e)
            {
                if (e.Button == MouseButtons.Left)
                {
                    DataGridView.HitTestInfo ht = dataGridView1.HitTest(e.X, e.Y);
                    if (ht.RowIndex >= 0 && ht.ColumnIndex >= 0)
                    {
                        this.dataGridView1.CurrentCell = dataGridView1[ht.ColumnIndex, ht.RowIndex];                    
                    }
                }
            }