Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > control.databindings
 

control.databindings

hello all, 

is there any way a control can be bound to a relation between two columns in a datasource 

ie 
Label lb = new Label(); 
DataTable dt = new DataTable(); 
lb.Databindings.Add("Text", dt, "DOB"-"DateRegistered") 

here "DOB" and "DateRegistered" are two columns in the datatable but i want the difference to be bound to the label. 

is this possible. 

thanks.
MigrationUser 1  Friday, March 12, 2004 11:04 AM
What you can do is to create a new column in the datatable that contains that formula and bind it to the control. The dataset will calculate that column on the fly, so when DOB or DateRegistered changed, the value in the new column will change to.

Suriyanto
MigrationUser 1  Friday, March 12, 2004 1:56 PM

You can use google to search for other answers

Custom Search

More Threads

• Adding controls to the toolbox.
• Populating Combobox from list of servers in registry
• DataGridView : Loads and then automatically Flush all Data
• Highlight Rows in Datalistview with Mouse Over
• Inter-Component Databinding?
• DataGridview Binding: Conditionally adding an unbound column
• Record Selector... :( Please Help!
• ListView Performance as Items Added
• Datagrid show few columns...
• CheckBox in Datagrid