Structured Document Tags (sdt) enable users to add specific semantics to part of the document: restricting input, modifying editing behavior etc.
Currently, RadRichTextBox only visualizes the value of the content controls and there is no UI that allow you to interact with them. The import and export operations will work with Office Open XML (docx) and XAML formats. When exporting to other formats the content controls will be lost, however their content (current value) will be exported.
The contented controls can be defined on Block, Inline, Row or Cell level. They can be nested inside each other as well. In addition, one can modify the editing behavior of the content controls. This means that you can lock the content of the content control, the entire content control or both.
The following content controls are not supported by Microsoft Word:
The above content controls share the following properties:
- Type: The type of the current content control.
- ID: Each content control must have a an unique ID.
- DataBinding: Gets or sets an XML mapping (DataBinding) that relates the content of associated SDT to a specific XML node.
Lock: This property controls if the entire content control or its contents can be edited or deleted. The possible values are:
- Unlocked: The content control can be edited and deleted.
- SdtLocked: The content control can be edited but cannot be deleted.
- ContentLocked: The content control cannot be edited, the entire content control can be deleted.
- SdtContentLocked: The content control cannot be edited or deleted.
- Alias: Gets or sets the name for the associated content control (this is necessary because the properties are stored in a separate object).
- OutlineColor: Gets or sets the color that is used for visualizing the outline.
OutlineAppearance: Represents the different options for visualizing the outline of a content control.The possible values are:
- BoundingBoxes: The content is wrapped in a bounding box that may also contain a specific editor.
- Tags: The content is wrapped in design view tag.
- None: The content does not have outline visualization.
The CheckBox content control exposes two properties CheckedState and UnCheckedState. Both properties are of type SdtCheckBoxState which allows you to set the respective character and its font. The Checked property specifies whether the checkbox is checked.
The ComboBox and DropDownList provide the user with options to choose from. The only difference is that when using ComboBox you can add a value that is not in the data source.
- Items: This property allows you to specify the predefined items.
- LastValue: This property returns the currently selected value.
The Date content control allows you to enter a date by using a calendar. The date content control has the following properties:
- DateFormat: Allows you to get/set the format string of the date. If it is omitted the default date format for the language is used.
- LanguageId: Allows you to get/set the CultureInfo object for the date format.
- DateTime: The current selected date, stored as string.
Calendar: Allows you to select the calendar type.