Tuesday 15 January 2013

c# - WinForms data binding to a custom property throws an exception -



c# - WinForms data binding to a custom property throws an exception -

i sorry if duplicate, searched net , haven't found answer

i trying bind control's enabled (or readonly textbox):

this.tbproj.databindings.add(new binding("enabled", this, "canedit", false, datasourceupdatemode.onpropertychanged, false)); this.btnsave.databindings.add(new binding("enabled", this, "dirty", false, datasourceupdatemode.onpropertychanged, false));

to next properties:

public bool dirty { get; set; } private bool canedit { { homecoming this._currentrecord.canedit(); } }

i system.argumentexception: cannot bind property or column canedit on datasource. when trying showdialog() form.

if bind enabled or readonly dirty, forks fine. tried get { homecoming true; } , added setter: set { bool bummy=value; }, same error. changed canedit auto-implemented property, same dirty (just get; set; in declaration) @ no avail...

please help.

thanks hints , advice.

the property has public:

public bool canedit { { homecoming this._currentrecord.canedit(); } }

c# winforms data-binding

No comments:

Post a Comment