We have the following operation to be performed on the control in our WinForms application.
public class BindableDataItem
{
public bool Visible {get; set; }
public bool Enabled {get;set;}
}
Now we want to bind the BindableDataItemto a TextBox.
Here are binding association.
TextBox.Enabled <==> BindableDataItem.Enabled
TextBox.Visible <==> BindableDataItem.Visible
Now one BindableDataItem object may associated with many controls with different type.
By calling (BindableDataItem) obj.Enabled = false should disable all the controls attached to the BindableDataItem object.
Any help shall be appreciated.
This is how it is done
Now bind the controls in your form to the your datasource.
Now you can enable/disable controls e.g