F
Frank Wisniewski
I have the following persudo code:
//My Form Class
class Form1 {
//Local Variable for my custom object
private MyCustomObject1
//Constructor for Form Class
public Constructor{
MyCustomObject1 = new MyCustomObject1();
MyCustomObject1.MyProp = "Test";
textbox.databindings.add("text", this._MyCustomObject1, "MyProp1");
}
public ChangeCustomObject {
MyCustomObject1 = new MyCustomObject1();
MyCustomObject1.MyProp = "Change Test";
}
}
//Custom Class the contains one Property
class MyCustomObject {
property string MyProp1;
}
I databind a text boxes text property to my MyCustomObjects MyProp1 property
once in the constructor. This works fine, if I update the text box, the
value for MyProp1 is also updated. But if I change MyCustomObject1 to a new
MyCustomObject, the text box is not updated unless I call the
Databindings.Add again. Is this suppose to work this way? Do I have to
call Databindings.Add each time I set myCustomObject1 to a new
myCustomObject?
Thanks in advance,
//My Form Class
class Form1 {
//Local Variable for my custom object
private MyCustomObject1
//Constructor for Form Class
public Constructor{
MyCustomObject1 = new MyCustomObject1();
MyCustomObject1.MyProp = "Test";
textbox.databindings.add("text", this._MyCustomObject1, "MyProp1");
}
public ChangeCustomObject {
MyCustomObject1 = new MyCustomObject1();
MyCustomObject1.MyProp = "Change Test";
}
}
//Custom Class the contains one Property
class MyCustomObject {
property string MyProp1;
}
I databind a text boxes text property to my MyCustomObjects MyProp1 property
once in the constructor. This works fine, if I update the text box, the
value for MyProp1 is also updated. But if I change MyCustomObject1 to a new
MyCustomObject, the text box is not updated unless I call the
Databindings.Add again. Is this suppose to work this way? Do I have to
call Databindings.Add each time I set myCustomObject1 to a new
myCustomObject?
Thanks in advance,