DataBinding problem

  • Thread starter Thread starter Mantorok
  • Start date Start date
M

Mantorok

Hi

I'm attempting to bind a Textbox.Text property to a custom object/property
in C#. My form has an instance of my class in a property called
Integration, I'm attempting to bind the textbox by:

< code >
txtFilename.DataBindings.Add("Text", Integration, "Filename") ;
< /code >

Everything is present and correct, Filename is a string type and my class is
instantiated fine, but .Net just says it can't bind to Filename property on
the textbox.

Sounds like a bug, but it's such a simple prospect that I would expect .Net
to handle.

Any ideas?
Thanks
 
Hi,

Just to be safe, ensure "Filename" is a public property of a type the
Integration object is instance of.
In other words, a code snippet like this:

string temp = Integration.Filename

should be compiled without errors.
 
Hi

Oh, it's definitely public, at the moment I'm using the properties to
populate each textbox "manually" and then setting the values from the
textbox to the class properties on closing the form.

Thanks
Kev

Dmitriy Lapshin said:
Hi,

Just to be safe, ensure "Filename" is a public property of a type the
Integration object is instance of.
In other words, a code snippet like this:

string temp = Integration.Filename

should be compiled without errors.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Mantorok said:
Hi

I'm attempting to bind a Textbox.Text property to a custom object/property
in C#. My form has an instance of my class in a property called
Integration, I'm attempting to bind the textbox by:

< code >
txtFilename.DataBindings.Add("Text", Integration, "Filename") ;
< /code >

Everything is present and correct, Filename is a string type and my
class
is
instantiated fine, but .Net just says it can't bind to Filename property on
the textbox.

Sounds like a bug, but it's such a simple prospect that I would expect .Net
to handle.

Any ideas?
Thanks
 
Back
Top