本文共 1263 字,大约阅读时间需要 4 分钟。
???????
DataGridView???C#?????????????????????????????????????????????DataGridView?????????????????????DataGridView?????????????
???DataGridView??????????????????????
??????????
??????????DataGridView???????????string headText = this.dataGridView1.Columns[this.dataGridView1.CurrentCell.ColumnIndex].HeaderText;
???dataGridView1 ?DataGridView??????CurrentCell ?????????????
??????????
???????????????????????????string name = this.dataGridView1.Columns[this.dataGridView1.CurrentCell.ColumnIndex].Name;
???????????DataGridView?????????????
private void getCurrentCellButton_Click(object sender, System.EventArgs e){ string msg = String.Format("Row: {0}, Column: {1}", dataGridView1.CurrentCell.RowIndex, dataGridView1.CurrentCell.ColumnIndex); MessageBox.Show(msg, "Current Cell");} ?????????DataGridView??????????????????
private void setCurrentCellButton_Click(object sender, System.EventArgs e){ // ?????????0??1? this.dataGridView2.CurrentCell = this.dataGridView1[1, 0];} DataGridView???CurrentCell ????????????????????????????
this.dataGridView1.CurrentCell = this.dataGridView1[1, 0];
???dataGridView1 ?DataGridView??????1 ??????0 ???????????????????????????
??????????????
转载地址:http://eerf.baihongyu.com/