Class MentionValueSelectingEventArgs<T>
Provides event data for the ValueSelecting event prior to selecting an item in the Mention control.
Inheritance
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 |
|
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 |
|
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 |
Remarks
Use this property to access the object being considered for selection in the Mention popup.