Developer FAQ

I would like to create a 'read only' field on my data type. The field should be visible (read only). How can I have the field visible, but read-only, when editing the data?

Answer:

There aren’t "out-of-the-box" read-only widgets, but you can get what you want by editing the data type's Form UI markup:

  1. Click Edit Form Markup in the context menu of your datatype.
  2. Under the <FieldGroup> element, locate the widget you want to make read-only. For example,
    <TextBox Label="Created" Help="Date of record creation.">
  3. Add the Type attribute setting it to "ReadOnly".
    <TextBox Label="Created" Help="Date of record creation." Type="ReadOnly">
  4. Save the markup.

This will give you a read only text box.

Note that the Form UI XML is available as a flat file below ~/App_Data/Composite/DynamicTypeForms/ where you can edit them using a program like Visual Studio.

You can get XML schemas (IntelliSense) by browsing to: http://localhost/Composite/schemas/FormsControls/GenerateDynamicSchemas.aspx (where localhost is the C1 server hostname).

Important! As long as the Form UI XML file exist in the path mentioned above, you will not be able to add, edit or delete fields in a regular way via C1 GUI. You will only be able to manage fields by editing this file. To reclaim the field management functionality, you should delete the file.