J
Joe
I have a DataBind() method which binds my controls to my business object.
There are times we changes the object without closing the screen and call
DataBind() again. DataBind() calls DataBindings.Clear() and each control
which I bind to before I reset the bindings.
The problem is the first time the binding is done Format gets called but it
doesn't get called after another call to DataBind().
I'm guessing it's because the values are the same but since Format is not
called the values now display their actual value instead of the formatted
value I need.
My binding looks like this for one of the controls:
Binding binding = control.DataBindings.Add("Text", myobject, "myProperty",
true, DataSourceUpdateMode.OnValidation, null);
binding.Format += new ConvertEventHandler(Property_Format);
I have also tried DataSourceUpdateMode.OnPropertyChanged
Any suggestions?
Joe
There are times we changes the object without closing the screen and call
DataBind() again. DataBind() calls DataBindings.Clear() and each control
which I bind to before I reset the bindings.
The problem is the first time the binding is done Format gets called but it
doesn't get called after another call to DataBind().
I'm guessing it's because the values are the same but since Format is not
called the values now display their actual value instead of the formatted
value I need.
My binding looks like this for one of the controls:
Binding binding = control.DataBindings.Add("Text", myobject, "myProperty",
true, DataSourceUpdateMode.OnValidation, null);
binding.Format += new ConvertEventHandler(Property_Format);
I have also tried DataSourceUpdateMode.OnPropertyChanged
Any suggestions?
Joe