dataGridList.DataSource = Ds.tbHuman.DefaultView; 表tbHuman的字段又绑定到一些TextBox .FindC =
ComFun.GetSql(Fname[base.cBoxFieldC.SelectedIndex],               Ftype[base.cBoxFieldC.SelectedIndex],
              base.cBoxCondC.SelectedIndex,               base.tBoxCondTxtC.Text);

string sql = FindA + " and " + FindB + " and " + FindC;
Ds.tbHuman.DefaultView.RowFilter = sql;经过上边的查询后,我怎么让TextBox 定位到DefaultView中选定的那一行

解决方案 »

  1.   

    Ds.tbHuman.FindBymanId((sender as DataGrid)[(sender as DataGrid).CurrentRowIndex,0].ToString());datatable 的指针为什么不移动,我的想法是不是不正确
      

  2.   

    WINFORM用Control.DataBinding.Add("Text",DataSource,"FieldName");来进行绑定就会通过FORM的BindingContext自动导航,不需要额外的处理.如果是WebForm,就只能通过SelectedIndexChanged事件先获取选中的行,再重新绑定TextBOX
      

  3.   

    BindingContext 好象只能是postion来移动吧
      

  4.   

    嘿嘿!我新手!不过这个我好象知道!
    打个比方 textbox1 的text属性和 dataset对象(ds是一个dataset对象)中的表 uid 的 字段“序号”绑定后如:
    TextBox1.DataBindings.Add(New Binding("text", ds.Tables(uid), "序号"))可以用: Me.BindingContext(ds.Tables(uid)).Position = row 来确定显示哪一行的字段值。(Me. 可有可无;那个 row 是个数值型是指要显示行的下标 )
      

  5.   

    你要通过设置绑定的Position属性才会起作用,具体看这里的例子,
    http://blog.csdn.net/zhzuo/archive/2005/01/03/238273.aspx