alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class ListBoxKeyDownEventArgs

    Provides event data for the ListBoxItemKeyDown event, which handles keyboard interactions in the SfListBox<TValue, TItem> component.

    Inheritance
    object
    ListBoxKeyDownEventArgs
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ListBoxKeyDownEventArgs
    Remarks

    Use this event to prevent or customize the response to key presses within the ListBox.

    Examples
    private void OnKeyDown(ListBoxKeyDownEventArgs args)
    {
        if (args.Event != null && args.Event.Key == "Delete") {
            args.PreventDefaultAction = true;
        }
    }

    Constructors

    ListBoxKeyDownEventArgs()

    Declaration
    public ListBoxKeyDownEventArgs()

    Properties

    Event

    Gets or sets the underlying KeyboardEventArgs associated with the key press.

    Declaration
    public KeyboardEventArgs Event { get; set; }
    Property Value
    Type Description
    KeyboardEventArgs

    An instance of KeyboardEventArgs containing information about the keyboard event.

    Remarks

    Use this property to determine which key was pressed and access key-related metadata for advanced behaviors.

    Examples
    var key = args.Event?.Key;

    PreventDefaultAction

    Gets or sets a value that determines whether to allow or prevent the default keyboard action in the ListBox.

    Declaration
    public bool PreventDefaultAction { get; set; }
    Property Value
    Type Description
    bool

    true if the default keyboard action should be prevented; otherwise, false. The default value is false.

    Remarks

    Set this property to true in your event handler to block standard keyboard behavior (such as deleting or moving items).

    Examples
    args.PreventDefaultAction = true;
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved