We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Selected index for Drop Down List of InlineContentControl

Hello, 

I am currently working on a project which use DocIO to read content of a Word document.

The document using an InlineContentControl which contain Drop Down List items.

My question is how to set/select a default item for this list items, such as item index 1,2.. instead of a blank item when Drop Down List created.

Thank you very much,


2 Replies

AA Akash Arul Syncfusion Team October 19, 2022 06:08 PM UTC

Hi Trinh,

From the given details, we have found that your requirement is to set/select the item of the drop-down list content control using DocIO library.

To achieve your requirement, we suggest you to iterate the Word document and find the block content control or inline content control. Then check whether its content control properties type is DropDownList and set the required drop-down list item display text as selected text (text range inside the inline or block content control).

Please refer our UG documentation link to know more about drop-down list content control in Word document,
https://help.syncfusion.com/file-formats/docio/working-with-content-controls#drop-down-list-and-combo-box

Please refer our UG documentation link to know how to iterate through the Word document,
https://help.syncfusion.com/file-formats/docio/word-document/iterating-word-document-elements

We have prepared the sample application to set/select the item of the drop-down list content control in a Word document as per your requirement and it can be downloaded from the below attachment.

Regards,
Akash A.


Attachment: DropDown_599d67dd.zip


TT Trinh Thang Long November 5, 2022 01:24 PM UTC

Thank you very much for your support. My problem has been solved! Thanks again for your great work!


Loader.
Live Chat Icon For mobile
Up arrow icon