We have a need to add multiple controls for UD fields to a customization (still in the Classic UI). These fields will all go together in a single group box. Kinetic has instances where all of the fields in a group box are enabled/disabled by a single checkbox on the form. (See SalesOrder > Header Manifest > General Intl.) How to we tap into the mechanism that Kinetic uses to do this? EpiGroupBox does not have support for iterating over the controls within it. At best, enumerating each field GUID by GUID is cumbersome. Currently doing something like this:
Thank you for correcting me and for your example. My original foreach had a typo that led to a misleading error that there was no built-in enumerator for that class. I learned it takes a little more fiddling to be able to do anything with the controls once you have them:
foreach (Control c in IntGrp.Controls)
{
if (c.GetType().Name != "EpiLabel")
{
switch (c.GetType().Name)
{
case "EpiTextBox":
EpiTextBox ctlTxt = (EpiTextBox)c;
ctlTxt.IsEpiReadOnly = Read_Only;
break;
case "EpiCheckBox":
EpiCheckBox ctlChk = (EpiCheckBox)c;
ctlChk.IsEpiReadOnly = Read_Only;
break;
case "EpiDateTimeEditor":
EpiDateTimeEditor ctlDTE = (EpiDateTimeEditor)c;
ctlDTE.IsEpiReadOnly = Read_Only;
break;
case "EpiCurrencyEditor":
EpiCurrencyEditor ctlCur = (EpiCurrencyEditor)c;
ctlCur.IsEpiReadOnly = Read_Only;
break;
}
}
}
Interesting because that is not the way Epicor handles it. I had added my fields into an existing GroupBox that is controlled by an existing checkbox. When checked, the fields in the GroupBox are enabled. However, when unchecked, the original fields in the GroupBox are disabled, but the fields I added are not. My fields maintained the state set in the designer regardless of the status of the checkbox.