DataBind数组到文本框
问题描述:
String[] names = new String[] { "A" , "B" , "C" , "D" , "E" };
textBox1.DataBindings.Add( "Text" , names , null );
如何将文本绑定到数组名称为[3]的元素4?
任何人都可以向我展示为上述情况提供2向装订的方法吗?
我尝试编辑textBox1的databind属性,但对我来说似乎很奇怪(需要从对象或数据库等中选择数据源),如何使用它,以便可以将其快速绑定到如上所示的数组. >
谢谢您的帮助.
How do i bind the text to element 4 of the array,names[3]?
Can anyone show me the way to provide 2-way binding for above situation?
I try to edit the databind property of textBox1 but it seem odd to me(need to select data source from object or database and etc),how to use that so i can quickly bind it to the array as shown at above.
Thx for your help.
答
我刚刚尝试了
I just tried
textBox1.DataBindings.Add( "Text" , names[3] , null );
对我有用.
which worked for me.