Read Only Fields in Edit Pages & Extended or Advanced Search

Tips submitted by ASP.NET Maker users
Post Reply
xgis
User
Posts: 68

Read Only Fields in Edit Pages & Extended or Advanced Search

Post by xgis »

By declaring fields as 'ReadOnly' it is possible to control which fields can be edited by users (eg Client Side Calculated Fields where direct user input is required or allowed).
However if the 'ReadOnly' code is issued in the incorrect event (eg Table-Specific | Common | Events) it may prevent users searching and filtering data using Extended or Advanced search resources.
By adding 'ReadOnly' = true; to one event and 'ReadOnly' = false; to another event it is possible to prevent users from editing the wrong field, but enabling users to filter data with those fields.

The events used to achieve this in this example are "Page_DataRendering" events.

To prevent manual user editing of a field during "Edit" session use Table-Specific | Edit Page | Page_DataRendering
FieldName.ReadOnly = true;

To enable Extended Search or Filtering of the same field use Table-Specific | Search Page | Page_DataRendering
FieldName.ReadOnly = false;

There are probably a number of pages and events to achieve this type of outcome, but this was my solution.


Post Reply