By Chris Diesel - 7/16/2013
I have a user control that implements IBusinessBindable and contains several lables and comboboxes. The overall usercontrol is bound to a businessobject but the lables and comboboxes contained within are not. How can I prevent the lables contained in the usercontrol from enabling/disabling based on the form's editing state? It doesn't matter if I set the IgnoreManageReadOnly on the labels to true or not.
Thanks!
|
By StrataFrame Team - 7/16/2013
You'll need to set the IgnoreManageReadOnlyState on the UserControl itself. The UserControl is being enabled/disabled, which in turn, it enabling/disabling all of its child controls.
|
By Chris Diesel - 7/16/2013
Everything is working good except that the usercontrol's field labels are disabled. Why would they get disabled if they are not bound to a business object? The labels that sit directly on the form don't enable/disable based on the editing state. This is what I'm trying to prevent.
Thanks!
|
By StrataFrame Team - 7/16/2013
A UserControl is a ContainerControl and when set to Enabled=false, all child controls are disabled. If you put several controls into a GroupBox and then set Enabled=false on the GroupBox, all of the child controls of the GorupBox will be disabled. If the EditingState of the UserControl is following the business object, then when the UserControl is set to Enabled=false through the EditingState, then all child controls will be disabled. It has nothing to do with the labels being bound and explicitly set to Enabled=false. In fact, the labels aren't ever touched. But since they belong to a parent ContainerControl that was disabled, they get disabled, too.
|