Click here to Skip to main content
12,350,369 members (27,701 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# 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
Oleksandr Kulchytskyi 26-Dec-12 15:44pm
Which UI farmework did you use ??
WPF or WinForms???

1 solution

Rate this: bad
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");

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2016
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