[求助]怎样获取DataGrid中某条记录中对应的某个字段的值
已取得datagrid中某条记录,现在要求这条记录的某个字段的值,怎么办啊
private void Form1_Load(object sender, System.EventArgs e)
{
sqlDataAdapter1.Fill(dataSet11);
this.dataGrid1.CurrentCellChanged += new System.EventHandler(this.dataGrid1_CurrentCellChanged);
}
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
{
MessageBox.Show ("Col is " + dataGrid1.CurrentCell.ColumnNumber
+ ", Row is " + dataGrid1.CurrentCell.RowNumber
+ ", Value is " + dataGrid1[dataGrid1.CurrentCell] );
}
好像这段代码是帮助里的 要学会看帮助呀~