Skip the wizard entirely write your own. Epicor uses them extensively in the way demonstrated below. In all Part Entry source has over 1000 lines of row rules to control all of the read only jazz on conditions. That’s their preferred way of handling that stuff.
So, I tried both examples provided yesterday and neither seem to work. The closest I got was modifying Joshua’s example merely to fire off the desired condition upon saving a record, then attempting to adjust a textbox control property within the met-condition code block.
(Note for those who may have searched this topic): This method is limited to controls bound to the data view only. So, if you have additional custom controls such as buttons which are not part of the data view, they will not be inclusive to the Row Rule action. Just a point of interest there.
This definitely does the job and also serves as a visual indicator that the record was saved successfully.
Thanks very much for sticking with me on this. I learned quite a bit here, including the reinforcement of the idea that data-specific controls are bound to the data view and should always be modified from the data view itself. This is the “EpiMagic™” that @josecgomez has routinely mentioned in the past.
Confirmed that I can successully modify control properties based on that original evaluation of the conditional. Does this mean I should switch back to that approach?
Absolutely not.
Joshua’s example is the correct method to use for data-specific controls bound to a data view. So, I’ve left that code in place. For non-bound control objects, such as buttons that I might need to disable, or hide, the EpiViewNotification method (with correctly-written conditional evaluations [cough-cough]) would be a good choice to include in this case.
For a quick and dirty route you should be able to do this:
//Global
EpiTextBox keybox;
//Initialize
keybox = (EpiTextBox)csm.GetNativeControlReference("your guid to your key control");
keybox.PropertyChanged += new PropertyChangedEventHandler(PropChange);
//Destroy
keybox.PropertyChanged -= new PropertyChangedEventHandler(PropChange);
}
private void PropChange(object o, EventArgs a)
{
EpiGroupBox box = (EpiGroupBox)csm.GetNativeControlReference("your guid to your group control with all your UD controls"); //you could instead ref the controls individually, you can access direct because they arent system controls
box.ReadOnly = ((EpiTextBox)o).ReadOnly;
}