Hi,
How should i add in the drop down list inside a cell of a table, but not form field.
image.png (2.5 KB)
Hi,
How should i add in the drop down list inside a cell of a table, but not form field.
image.png (2.5 KB)
Please use the following code example to insert the drop down list in the document. The input and output documents are attached.
Docs.zip (21.7 KB)
var doc = new Document(MyDir + "input.docx");
StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.DropDownList, MarkupLevel.Block);
sdt.ListItems.Add(new SdtListItem("Item 1"));
sdt.ListItems.Add(new SdtListItem("Item 2"));
sdt.ListItems.Add(new SdtListItem("Item 3"));
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
table.FirstRow.FirstCell.AppendChild(sdt);
doc.Save(MyDir + "out.docx");