menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CheckBoxField - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CheckBoxField

    Represents a checkbox form field in the SfPdfViewer2 component.

    Inheritance
    System.Object
    FormFieldInfo
    CheckBoxField
    Inherited Members
    FormFieldInfo.BackgroundColor
    FormFieldInfo.BorderColor
    FormFieldInfo.Bounds
    FormFieldInfo.Color
    FormFieldInfo.CustomData
    FormFieldInfo.FontFamily
    FormFieldInfo.FontSize
    FormFieldInfo.FontStyle
    FormFieldInfo.Id
    FormFieldInfo.IsReadOnly
    FormFieldInfo.IsRequired
    FormFieldInfo.Name
    FormFieldInfo.PageNumber
    FormFieldInfo.TextAlignment
    FormFieldInfo.Thickness
    FormFieldInfo.TooltipText
    FormFieldInfo.Type
    FormFieldInfo.Visibility
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class CheckBoxField : FormFieldInfo
    Remarks

    Initializes a new instance of the CheckBoxField class with the default field type set to "CheckBox."
    This field allows users to select or deselect an option in interactive PDF forms.

    Examples
    CheckBoxField checkBoxField = new CheckBoxField();
    checkBoxField.Name = "AcceptTerms";
    checkBoxField.IsChecked = true; // Marks the checkbox as selected.
    await viewer.AddFormFieldsAsync(new List<FormFieldInfo> { checkBoxField });

    Constructors

    CheckBoxField()

    Initializes a new instance of the CheckBoxField class in the SfPdfViewer2 component.

    Declaration
    public CheckBoxField()
    Remarks

    This constructor creates a checkbox field with the default field type set to "CheckBox."
    Checkbox fields allow users to select or deselect an option in interactive PDF forms.

    Examples
    CheckBoxField checkBoxField = new CheckBoxField();
    checkBoxField.Name = "AcceptTerms";
    checkBoxField.IsChecked = true; // Marks the checkbox as selected.
    await viewer.AddFormFieldsAsync(new List<FormFieldInfo> { checkBoxField });

    Properties

    IsChecked

    Gets or sets the checked state of the CheckBoxField in the SfPdfViewer2 component.

    Declaration
    public bool IsChecked { get; set; }
    Property Value
    Type Description
    System.Boolean

    A System.Boolean representing the checked state of the CheckBoxField.
    A value of true means the checkbox is selected, while false means it is not.

    Remarks

    Represents whether the checkbox field is selected or not in the CheckBoxField.
    Changing this property updates the checked state in the corresponding PDF form field.
    This property allows programmatic control over the selection of the checkbox.

    Examples
    CheckBoxField checkBoxField = new CheckBoxField();
    checkBoxField.IsChecked = true; // Marks the checkbox as selected.

    Value

    Gets or sets the value associated with the CheckBoxField in the SfPdfViewer2 component.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the value assigned to the checkbox field.

    Remarks

    The Value property represents the data assigned to the checkbox field when it is selected.
    This value typically corresponds to a predefined option or user-defined text that indicates the checked state of the checkbox.
    When the checkbox is unchecked, the value will be empty or set to the default unselected state.

    If a null or empty string is set to this property, it will automatically default to the value "Yes".

    Examples

    The following example demonstrates how to assign a value to the checkbox field:

    CheckBoxField checkBoxField = new CheckBoxField();
    checkBoxField.Value = "Accepted";
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved