datagridview中,如何选中一行或者一个数据
试了好多,都不行,我就想在网格中选中,然后让数据在下面的textBox中显示出来....谢谢各位了...
------解决方案--------------------this.dataGridView1.CurrentCell = this.dataGridView1[colIndex, rowIndex];
object value = this.dataGridView1.CurrentCell.Value;
if (value != null)
{
string strValue = value.ToString();
}
------解决方案--------------------private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
this.textBox1.Text = this.dataGridView1.CurrentCell.Value.ToString();
}