try..string value = this.DataGrid[0,0].ToString();

解决方案 »

  1.   

    可以看看dataGrid.CurrentCell這個屬性
      

  2.   

    sorry..string value = this.DataGrid1[0,0].ToString();
      

  3.   

    获取当前行第一列值..
    string value = this.DataGrid1[this.DataGrid1.CurrentRowIndex, 0].ToString();获得当前单元格值 ..
    string value = this.DataGrid1[this.DataGrid1.CurrentCell].ToString();
      

  4.   

    分情况,如果你使用默认风格
    this.DataGrid1[this.DataGrid1.CurrentRowIndex, 0].ToString();
    使用了风格的话 那么就不能这样
    就从风格的列中找具体代码忘记
      

  5.   

    获取行列,值datagrid.CurrentCell.ColumnNumber datagrid.CurrentCell.RowNumber dgSheet.Item(dgSheet.CurrentCell.RowNumber, datagrid.CurrentCell.ColumnNumber )
      

  6.   

    if (this.dataGridView1.CurrentRow != null)
                {
                    //比如将该行某列内容显示在TextBox1中
                    this.txtBH.Text = this.dataGridView1.CurrentRow.Cells["流水编号"].Value.ToString();
                    this.txtCH.Text = this.dataGridView1.CurrentRow.Cells["车号"].Value.ToString();
                }
      

  7.   

    //基于WindowsForms
    取出DataGrid当前行绑定的DataTable的值。如果DataRowView drv = (DataRowView)this.BindingContext[this.ds,this.ds.Tables[0].TableName].Current;
    获取到drv就可以改数据,
    DataRow dw = drv.Row; // 得到DataRow,
    string s = dw["col1"].ToString();//想得到某一列的值
    DataTable dt = dw.Table;//得到DataTable
    DataSet ds = dt.DataSet;
    如果需要更多的资料可以看这里,
    http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp