|
The DataGrid is bound to a data set, and the text box is also bound to the same data set, but when the DataGrid moves,
Why doesn't the data in the text box follow the data in the DataGrid?
Comrades, tell me how should I bind ...
private void BindText ()
{
//this.txtBH .DataBindings.Add ("Text", this.bsEmployee1, "employee.bh");
this.txtBH.DataBindings.Add (new Binding ("TEXT", bsEmployee1, "employee.bh"));
this.txtBM .DataBindings.Add ("Text", this.bsEmployee1, "employee.bm");
this.txtJIANZHAO.DataBindings.Add ("Text", this.bsEmployee1, "employee.jianzhao");
this.txtPHOTO.DataBindings.Add ("Text", this.bsEmployee1, "employee.photo");
this.txtXM.DataBindings.Add ("Text", this.bsEmployee1, "employee.xm");
this.txtZW.DataBindings.Add ("Text", this.bsEmployee1, "employee.zw");
this.dtpBDR.DataBindings.Add ("Text", this.bsEmployee1, "employee.bdr");
}
private void frm_Main_Load (object sender, System.EventArgs e)
{
this.EmpSqlcmd.Fill (this.bsEmployee1.employee);
BindText ();
SetDataComponentState (true);
}
The above code, where else to add something ... |
|