Hi all,
i want to set a larger number of fields read only (in one DataSource on my form). I know that i can set the whole DataSource read only (FormBuildDataSource.AllowEdit(false)), but i need that only for some fields.
Is there a way to loop throug the fields of a datasource and set them read only?
I answered to fast, you can add your code in a test: for example in an init() method in the formDataSource : if (yourTest) FormBuildDataSource.AllowEdit(false);
Hi,
thanks for the answer, but setting the grid to read only did not solve my problem. In fat, i have to set all fields on the DataSource except one…
And the Information is displayed in one grid as well as on another tab… So i found this a little error-prone to set each control ro/rw (e.g. if we add fields in the future to the datasource…)
Hi,
thanks a lot, but the problem is: How can i iterate through the fields of a datasource?
Because i don’t want to set the 20 fields of my DataSource RO only to keep one field RW. I think this is a little error-prone e.g. if we add fields in the future to the datasource…
Hi, If you need it dynamically, u have to write code. If not, set allowedit property to “No” in table or datasource of your form as per the need. Code datasource_ds.object(fieldnum(tablenum, fieldname)).allowedit(false) for all the fields except your field. If you feel you have more fields in the table, make the design group allowedit false. Regards, Kuppusamy S
Hi, If you need it dynamically, u have to write code
That was my intention - to write code to loop through the fields of a datasource. If it is not possible, it is ok (i will then follow the “(FormBuildDataSource.AllowEdit(false))”-way for 30 columns). But i just was wondering, if there is a way to do a loop :).
Hi, If you need it dynamically, u have to write code
That was my intention - to write code to loop through the fields of a datasource. If it is not possible, it is ok (i will then follow the “(FormBuildDataSource.AllowEdit(false))”-way for 30 columns). But i just was wondering, if there is a way to do a loop :).