menu

Blazor

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

    Show / Hide Table of Contents

    Class FormFieldFocusInEventArgs

    Provides event data when a user focuses on a form field in the SfPdfViewer2 component.

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

    The FormFieldFocusInEventArgs class contains information about the form field that has received focus, allowing developers to access its properties and execute custom logic in response to user interactions. This is useful for tracking and handling user interactions with form fields within the PDF viewer.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldFocusIn="@OnFormFieldFocusIn"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    SfPdfViewer2 Viewer;
    void OnFormFieldFocusIn(FormFieldFocusInEventArgs args)
    {
        // Access the form field that received focus
        Console.WriteLine($"Form field focused: {args.Field.Name}");
    
        // Implement custom logic when a form field gains focus
    }
    }

    Constructors

    FormFieldFocusInEventArgs()

    Declaration
    public FormFieldFocusInEventArgs()

    Properties

    Field

    Gets the form field object that received focus in the SfPdfViewer2 component.

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

    An instance of FormFieldInfo representing the form field that received focus.

    Remarks

    The Field property provides access to the form field that was interacted with, allowing you to retrieve its details and perform relevant actions when it gains focus.

    Examples
    <SfPdfViewer2 @ref="Viewer" Height="100%" Width="100%">
        <PdfViewerEvents FormFieldFocusIn="@OnFormFieldFocusIn"></PdfViewerEvents>
    </SfPdfViewer2>
    
    @code {
    void OnFormFieldFocusIn(FormFieldFocusInEventArgs args)  
    {  
        // Retrieve the focused form field  
        FormFieldInfo fieldInfo = args.Field;
        Console.WriteLine($"Form field focused: {fieldInfo.Name}");  
    
        // Implement additional logic
    }  
    }

    PageNumber

    Gets the page number where the form field received focus 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 focused.

    Remarks

    The PageNumber property specifies the page on which the form field gained focus. This property is read-only and helps identify the field's exact location within the PDF document.

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