I am working on a customization where I have added table UD05 as a child to DMRHead with the DMR number as the Key1 value. All of my fields are set up and work properly, however, I can’t get the fields bound to the UD05 table to change to read-only when the DMR is “closed” (the OpenDMR value is false).
The rest of the DMR Processing fields all become read-only when the record is closed and I would like to and need to have the UD05 fields do the same. What is the easiest way to do this? I’ve tested the following code below and it gets me close, but when I set the OpenDMR field to closed, it doesn’t grey out the UD05 field until the next time the DMR record is loaded. When the OpenDMR field is closed and I set it to open, however, the greyed-out UD05 field becomes active and available again. Any guidance is most appreciated.
Perhaps more of a hack, but it’s easy… In the past, if I had fields that I wanted to mimic the readonly status of another field I simply used a OnPropertyChanged event on the child controls.
EpiMagic is black magic - if you dont sacrifice enough chickens it doesnt curse the right person. In this case, I tried (and failed) at using ExtendedProps on the views, the issue was my ExtendedProps were always overwritten by the data coming from db. So I cheated
@Chris_Conn, I tried your method and it worked for the all of my components that were EpiTextBox type. I can’t seem to get it to work for EpiCheckBox, EpiDateTimeEditor, or EpiCombo type fields.
I’ve used the following code and had the same results based on my initial attempt of using an EpiViewNotification event:
I’ve tried combinations using the ExtendedProperty[“Enabled”] as well but to no avail. I’ve tried each option by itself, combined with one other, and combined with multiple. I’ve even tried setting something like:
chkContain.Enabled = false;
but I get a compile warning that .Enabled is obsolete and that ReadOnly should be used.
It almost seems like something is overriding the controls for the CheckBox, Combo, and Date fields. Any thoughts?
control.Enabled despite the warning from Epicor, is merely a .NET property, so you could also disable the warnings by placing this on top of your Customization. I do that as well, especially on some screens where I don’t even have an EpiBinding.
So much time messing around with only to have be something simple…classic. Is there somewhere to get a list of the Epi Control Properties for future reference?
I think the ExtendedProps will only work during Initialization, not during run-time (not dynamically). So yes, you have to use the other methods, or perhaps trigger a way for the form to re-evaluate the ExtendedProps.
Ultimately, you should use RowRule’s. But the above does the trick too. I think @Rich can elaborate a bit more, why they don’t like you using .Enabled
The Epicor UI uses Read-Only instead of Enabled as a WinForm control that is set “Enabled=False” will not take focus so there can be no Right Click Context Menu and the user cannot Select the data in the control to copy to the clipboard.
The Epicor UI also has special UI characteristics on Read-Only as we wanted the Read-Only controls to “Appear” disabled instead of appearing as Read-Only. Minor difference but makes for a much cleaner looking UI.