menu

Blazor

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

    Show / Hide Table of Contents

    Class FormFieldSelectedEventArgs

    Provides event data for the form field selected in the SfPdfViewer2 component.

    Inheritance
    System.Object
    FormFieldSelectedEventArgs
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class FormFieldSelectedEventArgs : Object
    Remarks

    The FormFieldSelectedEventArgs class gives access to details about the form field that was selected, allowing developers to retrieve its properties and apply necessary actions when the user selects it.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldSelected="@OnFormFieldSelected"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldSelected(FormFieldSelectedEventArgs args)
    {
        // Access details of the selected form field
        FormFieldInfo fieldInfo = args.Field;
        Console.WriteLine($"Form field selected: {fieldInfo.Name}");
    
        // Implement additional logic
    }
    }

    Constructors

    FormFieldSelectedEventArgs()

    Declaration
    public FormFieldSelectedEventArgs()

    Properties

    Field

    Gets the form field object that was selected in the SfPdfViewer2 component.

    Declaration
    public FormFieldInfo Field { get; }
    Property Value
    Type Description
    FormFieldInfo

    An instance of FormFieldInfo representing the selected form field.

    Remarks

    This property provides access to the form field that was selected, allowing you to retrieve its details and perform necessary actions when a user selects it.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldSelected="@OnFormFieldSelected"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
        // Define the OnFormFieldSelected event handler
        void OnFormFieldSelected(FormFieldSelectedEventArgs args)
        {
            // Access details of the selected form field
            FormFieldInfo fieldInfo = args.Field;
            Console.WriteLine($"Form field selected: {fieldInfo.Name}");
    
            // Implement additional logic
        }
    }

    IsProgrammaticSelection

    Gets a value indicating whether the form field selection was triggered programmatically in the SfPdfViewer2 component.

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

    A System.Boolean indicating whether the selection was programmatic (true) or user-initiated (false).

    Remarks

    The IsProgrammaticSelection property helps determine if the form field selection was initiated by the user through interaction with the SfPdfViewer2 component or if it was triggered programmatically via API calls.

    Examples
    void OnFormFieldSelect(FormFieldSelectedEventArgs args)
    {
        if (args.IsProgrammaticSelection)
        {
            Console.WriteLine("Form field selection was triggered programmatically.");
        }
        else
        {
            Console.WriteLine($"User selected form field: {args.Field.Name}");
        }
    
        // Implement additional logic
    }

    PageNumber

    Gets the page number where the form field was selected in the SfPdfViewer2 component.

    Declaration
    public int PageNumber { get; }
    Property Value
    Type Description
    System.Int32

    An System.Int32 representing the page number where the form field was selected.

    Remarks

    This property helps identify the location of the selected form field within the document.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldSelected="@OnFormFieldSelected"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldSelected(FormFieldSelectedEventArgs args)
    {
        // Retrieve the page number where the form field was selected
        int pageNumber = args.PageNumber;
        Console.WriteLine($"Form field selected on page: {pageNumber}");
    
        // Implement additional logic
    }
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved