Class MentionFieldSettings
The MentionFieldSettings
class is a configuration class that is used to specify which fields in a data source should be used for different aspects of a mention list,
For example, you can use this class to specify which fields in a data source should be used for the text and value of each item in the mention list, as well as an optional field for grouping items.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class MentionFieldSettings : OwningComponentBase
Remarks
This allows the mention list to be populated with data from the specified data source, making it easier for users to select items from the list. This can be useful in scenarios where users need to select items from a large or complex data set, such as selecting names from a list of contacts or selecting products from a catalog.
Examples
In this example, the MentionFieldSettings
class is used to specify that the Text
and ID
fields in the data source should be used for the text and value of each item in the mention list, respectively.
<SfMention TItem="Games" DataSource="@GamesData">
<ChildContent>
<MentionFieldSettings Value="ID" Text="Text"/>
</ChildContent>
<TargetComponent>
<div id="mentionTarget" ></div>
</TargetComponent>
</SfMention>
@code{
public class Games
{
public string ID { get; set; }
public string Text { get; set; }
}
List<Games> GamesData = new List<Games> {
new Games() { ID= "Game1", Text= "American Football" },
new Games() { ID= "Game2", Text= "Badminton" },
new Games() { ID= "Game3", Text= "Basketball" },
new Games() { ID= "Game4", Text= "Cricket" },
new Games() { ID= "Game5", Text= "Football" },
new Games() { ID= "Game6", Text= "Golf" }
};
}
Constructors
MentionFieldSettings()
Declaration
public MentionFieldSettings()
Properties
Disabled
Defines whether the particular field value is disabled or not.
Declaration
public string Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.String |
|
Remarks
This property specifies whether the particular field value in the drop-down-list is disabled or not.
If set to true
, the field value will be disabled; otherwise, it will be enabled.
GroupBy
Gets or sets a field in the data source that should be used for grouping items in the mention list.
Declaration
public string GroupBy { get; set; }
Property Value
Type | Description |
---|---|
System.String | A field in the data source that should be used for grouping items in the mention list.
The default value is |
IconCss
Gets or sets the CSS class which is used to specify the field in the data source that contains the CSS class name for the icon that should be displayed for each item in the mention list.
Declaration
public string IconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | A field in data source that contains the CSS class name for the icon that should be displayed for each item in the mention list. |
Text
Gets or sets a field that is used to specify the field in a data source that should be used as the display text for each item in the mention list.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | A field that is used to specify the field in a data source that should be used as the display text for each item in the mention list. |
Value
Gets or sets a field that is used to specify the field in a data source that should be used as the value for each item in the mention list.
Declaration
public string Value { get; set; }
Property Value
Type | Description |
---|---|
System.String | A field that is used to specify the field in a data source that should be used as the value for each item in the mention list. |
Methods
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |