为什么不用数据绑定呢?
如果用数据绑定的话,选择那一行,就会把相应的数据项显示到TextBox中.其实这个问题我已经回答过好多次啦:
首先取得数据,放到DataGrid里System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("server=localhost;database=northWind;uid=sa;password=1");
conn.Open();
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter("select * from customers",conn);
 dt = new System.Data.DataSet();
da.Fill(dt,"customers");
//绑定TextBox
this.textBox1.DataBindings.Add(dt,"customers.CustomerID");

解决方案 »

  1.   

    this.dataGrid1.DoubleClick += new system.EventHandler(this.dataGrid1_DoubleClick); // then in our handler we might do this. This assumes a double click sets 
    // the focus object value = dataGrid1[ dataGrid1.CurrentCell ]; 
    -------------------------------------------------------------------
    http://www.syncfusion.com/faq/winforms/Files/datagriddoubleclick.zip
    http://expert.csdn.net/Expert/topic/1577/1577810.xml?temp=.9558527
      

  2.   

    snof(雪狼):
    如果用选择的话联绑定都不用!cocosoft(pengyun) 的办法可能行,没试过!