Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MentionFieldSettings

    Show / Hide Table of Contents

    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
    System.Object
    MentionFieldSettings
    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

    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 string.Empty. This is optional and does not have to be specified if you do not want to group items in the mention list. If you do not specify a GroupBy, all items in the mention list will be displayed in a single, ungrouped list.

    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 Description
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved