PC Review


Reply
Thread Tools Rate Thread

data binding: using text and tags.

 
 
oracle
Guest
Posts: n/a
 
      14th Dec 2005
Greetings,

I have a combo box that I binded to a data set using text and tags. I
want it to display the DRT.Name property and have a DRT.UnitId as a
value.

this.drtComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("Tag", this.drtDataSet1, "DRT.UnitId"));
this.drtComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.drtDataSet1, "DRT.Name"));


What I would like to do now is also bind a label with the same Tag
propertie and have it change automatically when the combobox is
changed. I want the tag to be binded to the same DRT.UnitID as the
combobox and have that ID updated when the combobox changes. I would
then like to use that ID to display any other value in the dataset
matching that ID number. In this case displaying the DRT.SerialNumber
value.

this.snValueLabel.DataBindings.Add(new
System.Windows.Forms.Binding("Tag", this.drtDataSet1, "DRT.UnitId"));
this.snValueLabel.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.drtDataSet1,
"DRT.SerialNumber"));

However, the text of the label never changes when the combobox is
changed. Is their a way to make this work?

I can get it to work by detecting a change in the combo box and then
grabing the value ( ID value) and doing a query using that ID for any
other property matching that ID number.

Is this the easiest way of doing this??

Thank you

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Databindings and XML - Binding Text between XML Tags instead of XMLTag Atrribute Information theintrepidfox Microsoft ASP .NET 0 26th Nov 2007 12:55 PM
Data binding a text box si_owen Microsoft VB .NET 1 13th Oct 2006 03:50 PM
data binding and text box =?Utf-8?B?YWx5c3Nh?= Microsoft C# .NET 2 16th Mar 2005 03:20 AM
Binding data to a text box =?Utf-8?B?Y2hyaXM=?= Microsoft ASP .NET 1 21st Jul 2004 01:46 PM
Problem Using Data Binding Tags Wayne Wengert Microsoft ADO .NET 2 24th May 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:16 AM.