By definition, your field control must provide UI for both displaying and editing the value of a field. This is a typical case where you can use conditional templates. Use the following markup for the template:
First, the template registers the Telerik.Sitefinity.Web.UI namespace, to use the conditional template and SitefinityLabel.
It includes a ConditionalTemplateContainer with two templates in it - one for Read and one for Write mode. It specifies the condition on each of them to look at the value of the DisplayMode property. This property is available in the FieldControl class and is set through the definitions of your control, or automatically.
Each conditional template includes the controls that it needs to show. This sample only includes the required labels for TitleControl, DescriptionControl, and ExampleControl. These IDs correspond to the IDs that are used in the class's properties.
With this, you have a blank template, to which you can add the custom controls for your field control.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important
Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, Ipswitch, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.
Powered by Progress Sitefinity