Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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.
Posted 26-Dec-12 9:38am
Comments
Oleksandr Kulchytskyi at 26-Dec-12 15:44pm
   
Which UI farmework did you use ??
WPF or WinForms???

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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");
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,651
1 Sergey Alexandrovich Kryukov 6,400
2 CPallini 5,230
3 George Jonsson 3,574
4 Gihan Liyanage 2,542


Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100