Top 5 Features of ASP.NET Core ListBox | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (181).NET Core  (28).NET MAUI  (227)Angular  (113)ASP.NET  (49)ASP.NET Core  (81)ASP.NET MVC  (87)Azure  (42)Black Friday Deal  (1)Blazor  (236)BoldSign  (14)DocIO  (24)Essential JS 2  (110)Essential Studio  (200)File Formats  (73)Flutter  (136)JavaScript  (226)Microsoft  (122)PDF  (83)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (964)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (46)Webinar  (53)Windows Forms  (59)WinUI  (72)WPF  (163)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (11)Business intelligence  (55)Button  (4)C#  (164)Chart  (147)Chart of the week  (58)Cloud  (15)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (73)Development  (681)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (21)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (522)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (45)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (406)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (628)What's new  (341)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

Top 5 Features of ASP.NET Core ListBox

The Syncfusion ASP.NET Core Listbox is a feature-rich control that provides great functionalities rather than just displaying a list of items. It allows users to select one or more items using check boxes, with a mouse or through keyboard interactions. It can be populated using an array of strings or an array of objects. In this blog, I am going to walk you through five major features of the Listbox control:

  • Drag and drop
  • Grouping
  • Sorting
  • Filtering
  • Templating

Drag and drop

The ASP.NET Core Listbox provides an option to drag an item or a group of items and drop them within a single list box or among multiple list boxes. With this feature, multiple list boxes are mapped using the scope property, in which the values are the same.

You can also reorder items within a single list box or among multiple list boxes through keyboard interactions or using the toolbar. You can enable the toolbar by specifying the toolbarSettings property with the following options.

moveUpMoves the selected item upwards within the Listbox.
moveDownMoves the selected item downwards within the Listbox.
moveToMoves the selected item from a source Listbox to a destination Listbox.
moveFromMoves the selected item from a destination Listbox to a source Listbox.
moveAllToMoves all the items from a source Listbox to a destination Listbox.
moveAllFromMoves all the items from a destination Listbox to a source Listbox.

Drag and drop ASP.NET Core listbox


The ASP.NET Core Listbox control lets you wrap a nested element into a group based on its category. The category of each list item can be mapped with the groupBy field in the data table. The control creates headers for every group; they are for representational purposes only. They cannot be selected using a mouse or keyboard and are not bound to any data item.

The following code example demonstrates how to group a nested element.

<ejs-listbox id="listbox" dataSource="ViewBag.vegetableData">
        <e-listbox-fields groupBy="Category" text="Vegetable" value="Id"></e-listbox-fields>
public IActionResult grouping() {
  List<object> Data = new List<object> {
    new { Vegetable = "Cabbage", Category = "Leafy Greens", Id = "item1" },
    new { Vegetable = "Spinach", Category = "Leafy Greens", Id = "item2" },
    new { Vegetable = "Wheat grass", Category = "Leafy Greens", Id = "item3" },
    new { Vegetable = "Chickpea", Category = "Beans", Id = "item6" },
    new { Vegetable = "Green bean", Category = "Beans", Id = "item7" },
    new { Vegetable = "Horse gram", Category = "Beans", Id = "item8" },
    new { Vegetable = "Garlic", Category = "Bulb and Stem", Id = "item9" },
    new { Vegetable = "Nopal", Category = "Bulb and Stem", Id = "item10" },
    new { Vegetable = "Onion", Category = "Bulb and Stem", Id = "item11" }
  ViewBag.vegetableData = Data;
  return View();

The following screenshot showcases grouping in Listbox.Grouping in ASP.NET Core Listbox


In the ASP.NET Core Listbox control, you can sort items using the sortOrder property. You can use this property to sort both alphabetically and numerically. This property can be set to None, Ascending, or Descending, and the default value is None.

The following code snippet demonstrates how to sort items in descending order.

<ejs-listbox id="listbox" dataSource="ViewBag.vegetableData" sortOrder=”Descending”>

The following screenshot shows sorting in Listbox in descending order.Sorting in ASP.NET Core Listbox


In the ASP.NET Core Listbox control, you can enable filtering by specifying the allowFiltering property. The filtering can be performed using the filterType property or filtering event. The filterType property is used to specify the type of filtering, such as startswith, endswith, and contains, which perform filtering and display the result in the list box. The filtering event is used to perform custom filtering through the updateData method.

The following code example showcases filtering.

<ejs-listbox id="listbox" dataSource="ViewBag.vegetableData" allowFiltering="true" filtering="onfiltering">
    function onfiltering(e) {
        var query = new;
        query = (e.text !== '') ? query.where('Name', 'startswith', e.text, true) : query;
        e.updateData(@Html.Raw(JsonConvert.SerializeObject(, query);

Filtering in ASP.NET Core listbox


To provide flexibility, the ASP.NET Core Listbox offers template support. Users can render a custom user interface to display data items using the itemTemplate property. A template can include a mixture of static HTML and web controls.

The following code example shows templating.Note: The images were referenced from the wwwroot folder of the corresponding project.

<ejs-listbox id="listbox" dataSource="ViewBag.employeeData" itemTemplate= '<div><img class="e-img" src="../Employees/${Image}.png" alt="employee"/> <div class="e-name"> Name: ${Text} </div></div>'
<e-listbox-fields groupBy="Country" text="Text"></e-listbox-fields>
      .e-name {
            font-weight: bold;
            padding: 0 10px 10px;
        .e-img {
            padding: 10px 10px;
public IActionResult Index()  {
        List<object> Data = new List<object>{
                new { Text="Mona Sak", Image="1", Country="USA"},
                new { Text="Evie Nowak", Image="2", Country="USA" },
                new { Text="Britney Linden", Image="3", Country="ENGLAND" },
                new { Text="Jessica Bisset", Image="4", Country="ENGLAND" },
                new { Text="Gwen Brown", Image="5", Country="USA" }
         ViewBag.employeeData = Data;
         return View();

Note: The images were referenced from the wwwroot folder of the corresponding project.

The following screenshot showcases the custom user interface in Listbox.Templating in ASP.NET Core Listbox


I hope you now have a better understanding of the major features supported by the ASP.NET Core Listbox control. What else do you expect from a list box? Please share your thoughts in the comments section.

If you’re already a Syncfusion user, you can download Essential Studio for ASP.NET Core’s product setup to try out this control. Otherwise, you can download a free 30-day trial.

If you have any questions about these features, please contact us through our Support ForumDirect-Trac, or Feedback Portal. We are happy to assist you!


Share this post:

Comments (1)

Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed