Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple data binding to a property
Message
From
11/09/2003 10:46:56
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Simple data binding to a property
Miscellaneous
Thread ID:
00828163
Message ID:
00828163
Views:
65
From reading the docs, this should be possible, but I'm thinking that the DataSource needs to implement an interface that I'm missing.

I'd like to databind a control to a property. The property could be on a form or a business object class or a UI Services class of some kind. The following illustrates the problem.

If I drop two text boxes on a form, I can bind the Text properties:
this.txtBoxBound.DataBindings.Add("Text",this.txtBoxSource,"Text");
Then, any change in the value of the Text property of one, is reflected in the other.

So far, so good.

Now, I create a form field, txtvalue, and attempt to DataBind the textbox to that field:
string txtvalue = "";
.
.
.
this.txtBoxBound.DataBindings.Add("Text",this,"txtvalue");
Or, I create a public property, TxtValue that gets/sets this field, and attempt to bind to it:
this.txtBoxBound.DataBindings.Add("Text",this,"TxtValue");
In either case I get an exception, "Cannot bind to property or column TxtValue on DataSource"

What'm I doing wrong?

Thanks.
>>-Steve->>

Steve Sawyer
Geeks and Gurus, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform