| 发表于:2007-01-04 13:02:30 楼主 |
datagrid 綁定了數據集,文本框也綁定了相同的數據集,但在datagrid移動時, 文本框的數據為什麼不跟著datagrid的數據變動? 同志們,說一下我該怎麼綁定啊.... 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); } 上面這代碼,還有哪個地方要加一點什麼啊.... |
|
|
|
|