Skip to content

Commit 3e8790d

Browse files
Update content-control.md
1 parent ba769a4 commit 3e8790d

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

ej2-asp-core-mvc/document-editor/content-control.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ InlineContentControl: Among inline content inside, as a child of a paragraph. Bl
3030

3131
Content control can be inserted using `insertContentControl` method in editor module.
3232

33-
```c#
33+
{% highlight ts %}
3434
//Insert Rich Text Content Control
3535
container.documentEditor.editor.insertContentControl('RichText');
3636
//Insert Rich Text Content Control with default sfdt string
@@ -66,48 +66,35 @@ container.documentEditor.editor.insertContentControl('DropDownList', 'One', ['On
6666
container.documentEditor.editor.insertContentControl('Picture');
6767
//Insert Picture Content Control with default image
6868
container.documentEditor.editor.insertContentControl('Picture', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADgSURBVEhLY3jx4sV/WuDBafCluXH/D6ydhlWObIMPLmn8/32KPBiD2OjyKAY7+zbDsX945/91azehiBWU9IPVgVwJMxSX4SgG65jXwrGVa+v/6TOXoojBDEZ2LQh/m676/+D+/XBzQJgsg0EY5GqQgSCDsYUz2QaDMCiosIUvCKMYDFKIjK9dvYrCB3kXJIaMkfUjY5JdDEpioCCAYZCFyGbAMFkGI0fcMDUYpAgZY4s8EEYWwxWBJLsYhJHFQIYjmwHDQ9xgkGEwDCp0QAYji8EMRhYjymBq4lGDofjFfwCV5AGEIf9DQQAAAABJRU5ErkJggg==');
69-
```
69+
{% endhighlight %}
7070

7171
## Import content control properties
7272

7373
Content control properties can be set using the `ContentControlInfo` and import it using `importContentControlData`
7474

75-
```c#
75+
{% highlight ts %}
7676
var data = [];
77-
var contentControlData = new Object();
78-
contentControlData.title = placeHolderPrefix + 'Name';
79-
contentControlData.tag = '';
80-
contentControlData.value = 'John';
81-
contentControlData.canDelete = false;
82-
contentControlData.canEdit = false;
83-
contentControlData.type = 'RichText';
84-
data.push(contentControlData);
77+
var contentControlData = { title: placeHolderPrefix + 'Name', tag: '', value: 'John', canDelete: false, canEdit: false, type: 'RichText' };
8578
container.documentEditor.importContentControlData(data);
86-
```
79+
{% endhighlight %}
8780

8881
## Export content control properties
8982

9083
Content control properties can be exported using the `exportContentControlData`
9184

92-
```c#
85+
{% highlight ts %}
9386
var contentControlInfos = container.documentEditor.exportContentControlData();
94-
```
87+
{% endhighlight %}
9588

9689
## Reset content control
9790

9891
Content control properties can be reset using the `resetcontentcontroldata`
9992

100-
```c#
93+
{% highlight ts %}
10194
var data = [];
102-
var contentControlData = new Object();
103-
contentControlData.title = placeHolderPrefix + 'Name';
104-
contentControlData.tag = '';
105-
contentControlData.value = 'John';
106-
contentControlData.canDelete = false;
107-
contentControlData.canEdit = false;
108-
contentControlData.type = 'RichText';
95+
var contentControlData = { title: placeHolderPrefix + 'Name', tag: '', value: 'John', canDelete: false, canEdit: false, type: 'RichText' };
10996
data.push(contentControlData);
11097
container.documentEditor.resetContentControlData(data);
111-
```
98+
{% endhighlight %}
11299

113100
N> Content control with custom XML mapping of file type WordML is converted as normal Rich Text Content Control to provide lossless round-tripping upon saving.

0 commit comments

Comments
 (0)