ContentControl editing

I am absolutely desperate trying to make this work. The API seems to be faulty.

If I editor.exportContentControlData() > canEdit and canDelete will be FALSE but actually they are TRUE since I CAN delete and edit. Thats the first Problem

Second Problem is that in 3 days I have not managed to edit via API a single propery in one of the controls - it will ALWAYS overwrite ALL of them.

Third Problem is that if I import Via API it will always ignore my canEdit and canDelete values... so i am stuck with the default way which is without tags and without id.

>> every id = same > every value is updated - at least thats what I suspect.


When reverse engineereing the API i see that you can only adress via title / type combination - BUT you cannot insert with title- 


what am I missing ?


Thanks so muc


1 Reply

KM Kavitha Muralitharan Syncfusion Team May 5, 2025 01:31 PM UTC

Hi Nico Chiaro,


If I editor.exportContentControlData() > canEdit and canDelete will be FALSE but actually they are TRUE since I CAN delete and edit. Thats the first Problem

In Document Editor, we have maintained


To Disable Editing/Deleting content control, use "true".

To Enable Editing/Deleting content control, use "false".


We have attached a sample and video for your reference.

Sample: https://stackblitz.com/edit/vmvp1ric-hbyrn2sa?file=index.ts,index.html,data-default.json

Second Problem is that I have not yet managed to edit via API a single property in one of the controls - it will ALWAYS overwrite ALL of them.
You can use the getContentControlInfo API to get information about the selected content control, and you can modify the values of the properties and set them using setContentControlInfo.

// To get the selected content control information
container.documentEditor.selection.getContentControlInfo();


// Modify the value of the selected specific content control properties you want

// To set the changed values of content control properties
  container.documentEditor.editor.setContentControlInfo(existingCCP);


We have attached a sample and video for your reference.


Sample: https://stackblitz.com/edit/vmvp1ric-sgtj41sq?file=index.ts,index.html,data-default.json
Third Problem is that if I import Via API it will always ignore my canEdit and canDelete values... so i am stuck with the default way which is without tags and without id.
The importContentControlData, will only set the value of the content control properties. Instead of that, we suggest you use the getContentControlInfo API to get information about the selected content control, and you can modify the values of the properties and set them using setContentControlInfo.


Regards,

Kavitha M


Attachment: Demo_Reference_9c025766.zip

Loader.
Up arrow icon