Welcome Guest Search | Active Topics | Sign In | Register

PdfRadioButtonField Issue Options
Vikram
Posted: Sunday, November 19, 2017 4:55:04 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

I have the following code sample

var genderField = sourceReleaseDocument.Fields["M F Button"];
var test = genderField.Children;
var rt1 = (PdfRadioButtonField) test[0];
var te2 = (PdfOnOffField)rt;


No matter what I try I am not able to get a SelectedIndex on the intellisense in Visual Studio. I am not find an appropriate code sample either. However in one of the tickets from 2014, you have stated that the an issue with Radio button in PDF was fixed. I am currently using version 16.0.91.0. I'd appreciate if you can help out in finding out whether if I am doing something incorrect.

Reference Link

https://www.essentialobjects.com/forum/postst8168_EO-PDF--How-to-check-a-radio-button-when-filling-in-PDF-form.aspx
eo_support
Posted: Monday, November 20, 2017 1:14:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

The field you should be looking for is an PdfRadioButtonGroup, not a PdfRadioButtonField:

https://www.essentialobjects.com/doc/eo.pdf.pdfradiobuttongroup.aspx

For radio buttons, each PdfRadioButtonField represents a single radio button. The parent PdfRadioButtonGroup represents a group of radio buttons that makes up a single selection entity. SelectedIndex is on the PdfRadioButtonGroup class, not on PdfRadioButtonField class.

Thanks
Vikram
Posted: Monday, November 20, 2017 6:07:41 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Perfect that worked !! Thanks

Working code sample

var genderField = (PdfRadioButtonGroup) sourceReleaseDocument.Fields["M F Button"];
genderField.SelectedIndex = 1;
eo_support
Posted: Monday, November 20, 2017 6:14:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Great. Glad to hear that you got it working!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.