officefileapi-devexpress-dot-pdf-dot-pdfacroformfacade-dot-getradiogroupformfield-x28-system-dot-string-x29.md
Gets a specific radio group form field’s properties.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public PdfRadioGroupFormFieldFacade GetRadioGroupFormField(
string fullName
)
Public Function GetRadioGroupFormField(
fullName As String
) As PdfRadioGroupFormFieldFacade
| Name | Type | Description |
|---|---|---|
| fullName | String |
A form field’s name.
|
| Type | Description |
|---|---|
| PdfRadioGroupFormFieldFacade |
An object that contains the form field’s properties.
|
The PdfRadioGroupFormFieldFacade object contains form field and widget properties without access to the form field’s inner structure. Use the Widgets property to get the widget annotations’ settings associated with the form field.
The code sample below changes the radio group value and marker style:
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
pdfDocumentProcessor.LoadDocument("Documents//FormDemo.pdf");
PdfDocumentFacade documentFacade = pdfDocumentProcessor.DocumentFacade;
PdfAcroFormFacade acroForm = documentFacade.AcroForm;
//Set the radio group value:
PdfRadioGroupFormFieldFacade genderField = acroForm.GetRadioGroupFormField("Gender");
genderField.Value = genderField.Field.Items[2].Value;
//Change marker style for all radio buttons:
foreach (PdfRadioButtonWidgetFacade widget in genderField.Widgets)
{
widget.ButtonStyle = PdfAcroFormButtonStyle.Square;
}
pdfDocumentProcessor.SaveDocument("FormDemo_new.pdf");
}
Using pdfDocumentProcessor As New PdfDocumentProcessor()
pdfDocumentProcessor.LoadDocument("Documents//FormDemo.pdf")
Dim documentFacade As PdfDocumentFacade = pdfDocumentProcessor.DocumentFacade
Dim acroForm As PdfAcroFormFacade = documentFacade.AcroForm
'Set the radio group value:
Dim genderField As PdfRadioGroupFormFieldFacade = acroForm.GetRadioGroupFormField("Gender")
genderField.Value = genderField.Field.Items(2).Value
'Change marker style for all radio buttons:
For Each widget As PdfRadioButtonWidgetFacade In genderField.Widgets
widget.ButtonStyle = PdfAcroFormButtonStyle.Square
Next widget
pdfDocumentProcessor.SaveDocument("FormDemo_new.pdf")
End Using
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetRadioGroupFormField(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
pdf-document-api-get-checked-appearance-name-for-radio-button/CS/Program.cs#L20
// Specify a checked appearance name for the Female radio button:
PdfRadioGroupFormFieldFacade genderField = acroFormFacade.GetRadioGroupFormField("Gender");
foreach (PdfFormFieldItem item in genderField.Field.Items)
pdf-document-api-fill-interactive-form-fields/CS/PdfFormFilling/PdfFormFilling.cs#L65
PdfRadioGroupFormFieldFacade genderField = acroForm.GetRadioGroupFormField("Gender");
genderField.Value = genderField.Field.Items[0].Value;
pdf-document-api-get-checked-appearance-name-for-radio-button/VB/Program.vb#L15
' Specify a checked appearance name for the Female radio button:
Dim genderField As PdfRadioGroupFormFieldFacade = acroFormFacade.GetRadioGroupFormField("Gender")
For Each item As PdfFormFieldItem In genderField.Field.Items
pdf-document-api-fill-interactive-form-fields/VB/PdfFormFilling/PdfFormFilling.vb#L59
Dim genderField As PdfRadioGroupFormFieldFacade = acroForm.GetRadioGroupFormField("Gender")
genderField.Value = genderField.Field.Items(0).Value
See Also