alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class FormFieldFocusInEventArgs

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

    Inheritance
    object
    FormFieldFocusInEventArgs
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class FormFieldFocusInEventArgs
    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
    [JsonPropertyName("field")]
    [JsonInclude]
    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
    [JsonPropertyName("pageNumber")]
    [JsonInclude]
    public int PageNumber { get; }
    Property Value
    Type Description
    int

    An int 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
    }
    }
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved