Dropdownlist content control inside table cell using document builder c#

Hi
I am trying to add a content control , a dropdownlist,inside a table cell .How do i achieve that in c#.net using documentbuilder?

Thanks
Anu Cherian

Hi Anu,

Thanks for your inquiry. You can move cursor inside Cell and use the following code to insert an SDT (StructuredDocumentTag or Content Control):

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.DropDownList, MarkupLevel.Inline);
sdt.ListItems.Add(new SdtListItem("Aspose.Words", "1"));
sdt.ListItems.Add(new SdtListItem("Aspose.Cells", "2"));
sdt.ListItems.Add(new SdtListItem("Aspose.Pdf", "3"));
// doc.FirstSection.Body.FirstParagraph.AppendChild(sdt);
builder.InsertNode(sdt);
doc.Save(MyDir + @"17.3.0.docx");

Hope, this helps.

Best regards,

Hi Hafeez…

Great. Its working.

Thanks
Anu Cherian