c# - WinForms data binding to a custom property throws an exception -
I'm sorry if this is a duplicate, but I searched the net and I could not find any answer < I am trying to bind enabled (or
ReadOnly for
Textbox ) of control:
< Code> this TbProj.DataBindings.Add (new binding ("enabled", this, "CanEdit", incorrect, DataSourceUpdateMode.OnPropertyChanged, false)); This.btnSave.DataBindings.Add (new binding ("enabled", this, "dirty", false, datasource, updated. For the following properties:
get public dirty {get; Set; } Get back to CanEdit Private Bool {Receive} }} I get . System.ArgumentException: Can not bind property or column CanEdit to DataSource. when the ShowDialog () > form.
If I bind to enabled or read only to dirty , then everything is fine. I tried to get {return true; } and even a setter were added: set {bool bummy = value; } , same error I have also changed the CanEdit to an automatically applied property, same as dirty (only get; set; In the declaration) No benefit ...
Please help.
Thanks for any hints and advice.
property should be public:
public boolean canedit {get {Return.CurrentRecord.CanEdit (); }}
Comments
Post a Comment