Custom Widgets

Learn to create custom text box widgets with a button picker.

When you add or edit a data item, data fields are presented with widgets on the data form. C1 CMS provides you with a set of standard widgets used on data forms such as text boxes or drop-down lists.

A field of a certain type normally has a default widget assigned to it. Very often, you can change the default widget to a different one.

You can also create your own widgets as ASP.NET user controls (.ascx) and use them data forms:

The general approach is as follows:

  1. Create an ASP.NET user control.
  2. Register it in C1 CMS in the configuration file (~/App_Data/Composite/Composite.config).
  3. Use it as a widget for a proper field in a data type.

In Step 3, you can replace the default widget with your custom one by:

As to creating a custom widget, you can create it as a totally new form control or extending on existing ones.

The following two examples will show you how to create: