cjard
Well-known member
- Joined
- Apr 25, 2006
- Messages
- 7,081
- Programming Experience
- 10+
I have a typed DataRow to which I have added a property. All this property does is return a string. I cannot get a textbox to bind its .Text to this property, and I'm wondering if the bindingsource is the cause of the problem..
Suppose the datarow is just a single column, Column1
i can say in the immediate window:
myDataSet.myDataTable(0). MyProperty
"Hello world"
Now if I try this:
txbx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.myDataTableBindingSource, "Column1", true));
It works fine.
If I try this:
txbx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.myDataTableBindingSource, "MyProperty", true));
I get this:
Cannot bind to the property or column MyProperty on the DataSource.
Parameter name: dataMember
Where did it go wrong?
tia!
Suppose the datarow is just a single column, Column1
i can say in the immediate window:
myDataSet.myDataTable(0). MyProperty
"Hello world"
Now if I try this:
txbx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.myDataTableBindingSource, "Column1", true));
It works fine.
If I try this:
txbx.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.myDataTableBindingSource, "MyProperty", true));
I get this:
Cannot bind to the property or column MyProperty on the DataSource.
Parameter name: dataMember
Where did it go wrong?
tia!