使用C#.NET 2.0,我想一个文本框绑定到我的表的特定行。在示例:
Using c# .net 2.0 , I want to bind a textbox to a specific row of my table. In Example :
Table Person
ID NAME PRENOM SPECIAL_CATEGORY
1 BOB BOB mex
2 AL AL tot
3 PO PO pap
我想结合我的文本框的字段名所在的行包含special_categeory ='TOT'。 可能吗?或者我需要建立一个数据行此行的和有约束力的。
I want to bind my textbox on the field name where the row contains special_categeory = 'tot'. Is it possible? or I need to create a Datarow for this row and binding it.
您应该能够通过绑定...
You should be able to bind via...
myNameTextBox.DataBindings.Add( "Text", MyTable, "NAME" );
myPrenomTextBox.DataBindings.Add( "Text", MyTable, "PRENOM" );
mySpecial_CategoryTextBox.DataBindings.Add( "Text", MyTable, "SPECIAL_CATEGORY" );
其实,我只是一个框架,通过滚动的所有控件,如果他们在一个给定的表匹配的列名,他们立即约束自己像上面。
I actually have a framework that scrolls through all controls, and if they match a column name in a given table, they immediately bind themselves like above.
然后,当你滚动网格,它应该也刷新了个人文本控件在表单中了。
Then, when you scroll the grid, it should also refresh the individual text controls in your form too.
上一篇:在返回null ConfigurationManager.AppSettingsnull、ConfigurationManager、AppSettings
下一篇:如何prevent控制在视觉上落后于调整内部的TableLayoutPanel?落后、视觉、prevent、TableLayoutPanel