private void DataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
  {
            if (e.RowIndex >= 0)
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Right)
                {

                     dataGridView1.CurrentCell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
                    //this.DataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true;
                }
            }
  }

posted on 2010-10-05 20:13  赤色彗星  阅读(1492)  评论(0编辑  收藏  举报