Free Support Forum - aspose.com

Group of checkboxes

Hi,

I’d like to create a group of checkboxes as follows:

foreach (string choice in choices)
{
    CheckboxField checkboxField = new CheckboxField(page, new Rectangle(25, lowerlefty, 40, upperrighty - 10));
    checkboxField.AlternateName = $"select {choice}";
    checkboxField.Checked = false;
    checkboxField.Style = BoxStyle.Circle;
    checkboxField.HorizontalAlignment = HorizontalAlignment.Left;
    checkboxField.Contents = name;
    checkboxField.Value = name;
    // does not compile -> checkboxField.IsGroup = true;
}

The property IsGroup has no setter, even if the document says it has.

Best regards,
zimmy

(Working with 17.n)

My mistake. Sorry. I confused it.

@zimmy

Thanks for your acknowledgement.

We would like to share that you can add radio buttons in form with border style as box, to add grouped checkboxes inside PDF. We have shared this information so that it can help others looking for implementation of similar functionality. In event of any further query, please feel free to contact us.

That works. Thanks. I have to show a label right next to the checkbox and I use the Caption property (typeof TextFragment). But nothing appears.

Best regards,
zimmy

@zimmy

Thanks for your feedback.

Would you please share a sample code snippet which you are using to add checkboxes in PDF file. We will test the scenario in our environment and address it accordingly.