谢谢

解决方案 »

  1.   

    x=((DataTable)datagrid1.DataSource)[datagrid.CurrentRowIndex]["字段名"]
      

  2.   

    同学,你装个MSDN2003不是那么难吧?查一下就知道了
      

  3.   

    你比如你在编辑的时候
    选种了一行 就是这样     XX = e.Item.Cells(0).Text
    单元格: XX=DATAGRID.Items(i).Cells(1).Text.Trim()
      

  4.   

    x=((DataTable)datagrid1.DataSource).DefaultView.Rows[datagrid.CurrentRowIndex]["字段名"]
      

  5.   

    zhxudong(zhxudong)大哥,拜托你测试一下。
      

  6.   

    string id=e.Item.Cells[1].Text;//得到当前行的某个值
    正解
      

  7.   

    string s1=this.dataSet11.Tables["tablename"].Rows[this.dataGrid1.CurrentRowIndex]["columnname"].ToString();
      

  8.   

    string str=DataGrid1.Items[e.Item.ItemIndex].Cells[要取的column].Text();
    string str=e.Item.Cells[要取的column].Text();int i=DataGrid1.CurrentPageIndex*DataGrid1.PageSize+e.Item.ItemIndex;
    string str=DataSource.Roew[i]["要取的column"].Tostring();   //DataSource:记录DataGrid数据源的DataTable
      

  9.   

    楼上的朋友说的不对,当对DATAGRID排序时选择的值就错了.必须用BindMangerViewBase来处理.
    如:
    System.Windows.Forms .BindingManagerBase bm=this.dataGrid1 .BindingContext [this.dataGrid1 .DataSource ,this.dataGrid1 .DataMember ];
    DataRow dr=((DataRowView)bm.Current ).Row;
    ClientName=dr["姓名"].ToString ();