绑定数据表中某行的文本框。 [英] Bind a text box from a certain row in a datatable.

查看:54
本文介绍了绑定数据表中某行的文本框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据表,并希望将文本框绑定到该数据表中的特定行。数据表有三列;名称,价值和CoilNumber。当选择不同的线圈编号时,绑定行将改变。 名称列中此表中的一行是''CGLg''。如何将文本框绑定到名称column =''CGLg''和''CoilNumber''= 1的''Value''列?这似乎是一个简单的概念,但并不是那样的。

解决方案

似乎我不得不在磕磕绊绊之前问这个愚蠢的问题。这是其他任何可能正在寻找相同解决方案的人。



 cgGapInputNumericBox.DataBindings.Add( ,DataTable(  Name ='CGGap'and CoilNumber =' + _val.ToString()+   '), ); 


I have a data table and would like to bind a text box to a particular row from that data table. The data table has three columns; Name, Value & CoilNumber. The binding row will change when a different coilnumber is selected. One of the rows in this table from the "Name" column is ''CGLg''. How can I bind a text box to the ''Value'' column where the name column = ''CGLg'' and ''CoilNumber'' = 1? It seems like simple concept but isn''t turning out that way.

解决方案

Seems like I had to ask the stupid question before stumbling upon the answer. Here it is for anyone else who might be looking for the same solution.

cgGapInputNumericBox.DataBindings.Add("Value",DataTable("Name = 'CGGap' And CoilNumber = '" + _val.ToString() + "'") , "Value");


这篇关于绑定数据表中某行的文本框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆