menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MentionValueSelectingEventArgs<T> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class MentionValueSelectingEventArgs<T>

    Provides event data for the ValueSelecting event prior to selecting an item in the Mention control.

    Inheritance
    System.Object
    MentionValueSelectingEventArgs<T>
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class MentionValueSelectingEventArgs<T> : Object
    Type Parameters
    Name Description
    T

    Specifies the data type of the Mention component.

    Remarks

    You can use this event to conditionally cancel or modify the selection before it is finalized. For example, you may prevent certain items from being selected or implement custom validation logic.

    Examples

    Usage example of the ValueSelecting event:

    <SfMention TValue="Employee" DataSource="@Employees" ValueSelecting="OnMentionValueSelecting">
    </SfMention>
    @code {
        private void OnMentionValueSelecting(MentionValueSelectingEventArgs<Employee> args)
        {
            if (args.ItemData != null && args.ItemData.Name == "John")
                args.Cancel = true;
        }
    }

    Constructors

    MentionValueSelectingEventArgs()

    Declaration
    public MentionValueSelectingEventArgs()

    Properties

    Cancel

    Gets or sets a value indicating whether the item selection action should be canceled.

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

    true to cancel the selection; otherwise, false. Default is false.

    Remarks

    Set this property to true inside your handler to prevent selection of the current item in the Mention popup.

    IsInteracted

    Gets a value indicating whether this event was triggered by user interaction (such as keyboard selection or mouse click).

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

    true if the event is triggered by a user action (keyboard or mouse); otherwise, false.

    Remarks

    This property allows you to differentiate between user-initiated and programmatic selection scenarios within the Mention component.

    ItemData

    Gets or sets the selected item of type T from the Mention data source.

    Declaration
    public T ItemData { get; set; }
    Property Value
    Type Description
    T

    The selected data item. Default is null if no selection was made.

    Remarks

    Use this property to access the object being considered for selection in the Mention popup.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved