D
Dan Tallent
I have a scenerio when my forms are first opened that the user cannot modify
the data. The fields are disabled to prevent them from modifying any of the
data. If a user wishes to modify the data he would be required to click a
"Edit" button which will test permissions or status information of the
record. If the application determines it is ok for the user to modify the
data, it enables the fields where the user now can make changes as
necessary. When the user is finished they can click the save button. The
fields background color is changed to reflect the edit-status of the field.
I have noticed that the read only flag seems to handle this situation,
however I do have one problem. Some of the fields on the form should
remain read-only. If I write a loop to enable/disable all of the controls
on the form then the "read-only" fields are enabled as well. I could write
code for each field but this seems a little backward to me. How is this
type of scenerio usually handled? I thought of adding a new property to
my controls, but then I would be required to inherit every possible user
control. I imagine there has to be a better way so I could continue to use
the standard controls and not have to write code for every control on the
form.
Anyone have any ideas on how this is normally addressed?
Thanks
Dan
the data. The fields are disabled to prevent them from modifying any of the
data. If a user wishes to modify the data he would be required to click a
"Edit" button which will test permissions or status information of the
record. If the application determines it is ok for the user to modify the
data, it enables the fields where the user now can make changes as
necessary. When the user is finished they can click the save button. The
fields background color is changed to reflect the edit-status of the field.
I have noticed that the read only flag seems to handle this situation,
however I do have one problem. Some of the fields on the form should
remain read-only. If I write a loop to enable/disable all of the controls
on the form then the "read-only" fields are enabled as well. I could write
code for each field but this seems a little backward to me. How is this
type of scenerio usually handled? I thought of adding a new property to
my controls, but then I would be required to inherit every possible user
control. I imagine there has to be a better way so I could continue to use
the standard controls and not have to write code for every control on the
form.
Anyone have any ideas on how this is normally addressed?
Thanks
Dan