Overview

  • Nancy Davolio (Sales Representative)
  • Andrew Fuller (Vice President, Sales)
  • Janet Leverling (Sales Representative)
  • Margaret Peacock (Sales Representative)
  • Steven Buchanan (Sales Manager)
  • Michael Suyama (Sales Representative)
  • Robert King (Sales Representative)
  • Laura Callahan (Inside Sales Coordinator)
  • Anne Dodsworth (Sales Representative)

Selected item: Nancy Davolio (Sales Representative)

Our Blazor List Box component allows users to select items from a list of predefined strings. The component can be bound to any IEnumerable data source. The list of selected items can be accessed and/or specified via the Values property. To track selection changes, use the SelectedItemsChanged event or the two-way synchronization as demonstrated in this module.

In this demo, the component allows users to select a single item. Select an item to view corresponding object property values.

The List Box supports keyboard navigation (list of supported keyboard shortcuts), allowing users to navigate through List Box items and select values as needed.

 Multiple Selection

  • Nancy Davolio (Sales Representative)
  • Andrew Fuller (Vice President, Sales)
  • Janet Leverling (Sales Representative)
  • Margaret Peacock (Sales Representative)
  • Steven Buchanan (Sales Manager)
  • Michael Suyama (Sales Representative)
  • Robert King (Sales Representative)
  • Laura Callahan (Inside Sales Coordinator)
  • Anne Dodsworth (Sales Representative)
Selected Items:
  • Nancy Davolio (Sales Representative)
  • Andrew Fuller (Vice President, Sales)

To enable multiple selection in the List Box, set the SelectionMode property to ListBoxSelectionMode.Multiple.

  • If the ShowCheckboxes option is enabled, users can click individual items and corresponding checkboxes or hold Shift to select a range of items.
  • If the ShowCheckboxes option is disabled, users can press Ctrl to select individual items or hold Shift to select a range of items.

 Filter Data

Seattle
London
Tacoma
First Name Last Name Title City
Nancy Davolio Sales Representative Seattle
Andrew Fuller Vice President, Sales Tacoma
Janet Leverling Sales Representative Kirkland
Margaret Peacock Sales Representative Redmond
Steven Buchanan Sales Manager London
Michael Suyama Sales Representative London
Robert King Sales Representative London
Laura Callahan Inside Sales Coordinator Seattle
Anne Dodsworth Sales Representative London

Filter Criteria: null

The DevExpress Blazor List Box allows you to filter data in code. To apply filter criteria, create a criteria operator object that specifies a filter expression and send this object to the SetFilterCriteria method. To obtain the applied filter criteria, use the GetFilterCriteria method.

When a filter is applied, the ListBox raises its FilterCriteriaChanged event.

You can call the ClearFilter method to clear previously applied filters and apply a new filter to List Box data.

For more information, refer to the following help topic: Filter Criteria.

 Multiple Columns

Id Name Surname
1 Nancy Davolio
2 Andrew Fuller
3 Janet Leverling
4 Margaret Peacock
5 Steven Buchanan
6 Michael Suyama
7 Robert King
8 Laura Callahan
9 Anne Dodsworth

Selected item: Nancy Davolio (Sales Representative)

The List Box can display data across multiple columns. To create columns, use DxListEditorColumn objects that include the following options for column customization:

  • Caption — Specifies the column caption.
  • FieldName — Specifies the data source field that populates column items.
  • Visible — Specifies the column visibility.
  • VisibleIndex — Specifies the column display order.
  • Width — Specifies the column width.

 Group Data

  • Argentina
  • Patricio Simpson
  • Yvonne Moncada
  • Sergio Gutiérrez
  • Austria
  • Roland Mendel
  • Georg Pipps
  • Belgium
  • Catherine Dewey
  • Pascale Cartrain
  • Brazil
  • Pedro Afonso
  • Aria Cruz
  • André Fonseca
  • Mario Pontes
  • Bernardo Batista
  • Lúcia Carvalho
  • Janete Limeira
  • Anabela Domingues
  • Paula Parente
  • Canada
  • Elizabeth Lincoln
  • Yoshi Tannamuri
  • Jean Fresnière
  • Denmark
  • Jytte Petersen
  • Palle Ibsen
  • Finland
  • Pirkko Koskitalo
  • Matti Karttunen
  • France
  • Frédérique Citeaux
  • Laurence Lebihan
  • Janine Labrune
  • Martine Rancé
  • Carine Schmitt
  • Daniel Tonini
  • Annette Roulet
  • Marie Bertrand
  • Dominique Perrier
  • Mary Saveley
  • Paul Henriot
  • Germany
  • Maria Anders
  • Hanna Moos
  • Sven Ottlieb
  • Peter Franken
  • Philip Cramer
  • Renate Messner
  • Alexander Feuer
  • Henriette Pfalzheim
  • Horst Kloss
  • Karin Josephs
  • Rita Müller
  • Ireland
  • Patricia McKenna
  • Italy
  • Paolo Accorti
  • Giovanni Rovelli
  • Maurizio Moroni
  • Mexico
  • Ana Trujillo
  • Antonio Moreno
  • Francisco Chang
  • Guillermo Fernández
  • Miguel Angel Paolino
  • Norway
  • Jonas Bergulfsen
  • Poland
  • Zbyszek Piestrzeniewicz
  • Portugal
  • Lino Rodriguez
  • Isabel de Castro
  • Spain
  • Martín Sommer
  • Diego Roel
  • Eduardo Saavedra
  • José Pedro Freyre
  • Alejandra Camino
  • Sweden
  • Christina Berglund
  • Maria Larsson
  • Switzerland
  • Yang Wang
  • Michael Holz
  • UK
  • Thomas Hardy
  • Victoria Ashworth
  • Elizabeth Brown
  • Ann Devon
  • Helen Bennett
  • Simon Crowther
  • Hari Kumar
  • USA
  • Howard Snyder
  • Yoshi Latimer
  • John Steel
  • Jaime Yorres
  • Fran Wilson
  • Rene Phillips
  • Paula Wilson
  • Jose Pavarotti
  • Art Braunschweiger
  • Liz Nixon
  • Liu Wong
  • Helvetius Nagy
  • Karl Jablonski
  • Venezuela
  • Manuel Pereira
  • Carlos Hernández
  • Carlos González
  • Felipe Izquierdo

To help you deliver the best possible user experience, our Blazor List Box allows you to organize its list items into groups.

Use the GroupFieldName property to group data within our Blazor List Box (Group field values appear as group headers the list).

Note the following when using this option:

  • The List Box supports a single group level.
  • Users cannot collapse groups.
  • Group headers are not used for search operations.
  • Multi-column List Box controls also support groups.
  • You can use the GroupHeaderDisplayTemplate property to customize group headers.

 Disabled Items

  • Chai
  • Chang
  • Aniseed Syrup
  • Chef Anton's Cajun Seasoning
  • Chef Anton's Gumbo Mix
  • Grandma's Boysenberry Spread
  • Uncle Bob's Organic Dried Pears
  • Northwoods Cranberry Sauce
  • Mishi Kobe Niku
  • Ikura
  • Queso Cabrales
  • Queso Manchego La Pastora
  • Konbu
  • Tofu
  • Genen Shouyu
  • Pavlova
  • Alice Mutton
  • Carnarvon Tigers
  • Teatime Chocolate Biscuits
  • Sir Rodney's Marmalade
  • Sir Rodney's Scones
  • Gustaf's Knäckebröd
  • Tunnbröd
  • Guaraná Fantástica
  • NuNuCa Nuß-Nougat-Creme
  • Gumbär Gummibärchen
  • Schoggi Schokolade
  • Rössle Sauerkraut
  • Thüringer Rostbratwurst
  • Nord-Ost Matjeshering
  • Gorgonzola Telino
  • Mascarpone Fabioli
  • Geitost
  • Sasquatch Ale
  • Steeleye Stout
  • Inlagd Sill
  • Gravad lax
  • Côte de Blaye
  • Chartreuse verte
  • Boston Crab Meat
  • Jack's New England Clam Chowder
  • Singaporean Hokkien Fried Mee
  • Ipoh Coffee
  • Gula Malacca
  • Rogede sild
  • Spegesild
  • Zaanse koeken
  • Chocolade
  • Maxilaku
  • Valkoinen suklaa
  • Manjimup Dried Apples
  • Filo Mix
  • Perth Pasties
  • Tourtière
  • Pâté chinois
  • Gnocchi di nonna Alice
  • Ravioli Angelo
  • Escargots de Bourgogne
  • Raclette Courdavault
  • Camembert Pierrot
  • Sirop d'érable
  • Tarte au sucre
  • Vegie-spread
  • Wimmers gute Semmelknödel
  • Louisiana Fiery Hot Pepper Sauce
  • Louisiana Hot Spiced Okra
  • Laughing Lumberjack Lager
  • Scottish Longbreads
  • Gudbrandsdalsost
  • Outback Lager
  • Flotemysost
  • Mozzarella di Giovanni
  • Röd Kaviar
  • Longlife Tofu
  • Rhönbräu Klosterbier
  • Lakkalikööri
  • Original Frankfurter grüne Soße

Use the DisabledFieldName property to disable individual items within a List Box. The property specifies a Boolean field and stores each item's enabled or disabled state. Disabled items are grayed out and cannot be selected.

Note: Disabled items can improve overall usability but cannot replace appropriate security protocols (Users may still be able to select disabled items on the client side – as such, you should implement appropriate security-related checks in code).

 Virtual Scrolling

  • Afghanistan
  • Albania
  • Algeria
  • American Samoa
  • Andorra
  • Angola
  • Anguilla
  • Antigua and Barbuda
  • Argentina
  • Armenia
  • Aruba
  • Australia
  • Austria
  • Azerbaijan
  • Bahamas
  • Bahrain
  • Bangladesh
  • Barbados
  • Belarus
  • Belgium

The ListRenderMode property specifies how the List Box renders the item list.

  • Entire — The List Box renders the entire item list. Use this option for small item lists where scrolling should be instantly.
  • Virtual — The List Box renders items only after they appear in the viewport. This approach improves performance when the list contains many items.

In this demo, the ListRenderMode property is set to ListRenderMode.Virtual.

 Item Values

  • Nancy Davolio (Sales Representative)
  • Andrew Fuller (Vice President, Sales)
  • Janet Leverling (Sales Representative)
  • Margaret Peacock (Sales Representative)
  • Steven Buchanan (Sales Manager)
  • Michael Suyama (Sales Representative)
  • Robert King (Sales Representative)
  • Laura Callahan (Inside Sales Coordinator)
  • Anne Dodsworth (Sales Representative)
Selected Values:
  • 1
  • 2

The List Box component provides access to item values. The value is assigned to the editor's value when a user selects an item from the list. To enable this access, set the ValueFieldName property to the name of the data source field that ships with values for the List Box items.

If the ValueFieldName property is not specified, the List Box component searches for a Value field in the data source and uses this field as a value field. Otherwise, values are not assigned to editor items.

To access values of the selected items, use the Values property. To track selection changes, use the ValuesChanged event or two-way synchronization as demonstrated in this module.

 Item Display Template

  • Nancy Davolio
    Nancy Davolio (206) 555-9857 Nancy received a BA degree in psychology from Colorado State University in 2000. She also completed "The Art of the Cold Call" course. She is a member of Toastmasters International.
  • Andrew Fuller
    Andrew Fuller (206) 555-9482 Andrew received his BTS commercial in 1987 and a Ph.D. in international marketing at the University of Dallas in 1994. He speaks French and Italian fluently, and reads German. He joined the company as a sales representative. After that, he was promoted to sales manager in January 2005 and vice president of sales in March 2006. Andrew is a member of the Sales Management Round table, Seattle Chamber of Commerce, and Pacific Rim Importers Association.
  • Janet Leverling
    Janet Leverling (206) 555-3412 Janet received a BS degree in chemistry at Boston College in 2006. She also completed a certificate program in food retailing management. Janet was hired as a sales associate in 2013 and promoted to sales representative in February 2014.
  • Margaret Peacock
    Margaret Peacock (206) 555-8122 Margaret received a BA degree in English literature at Concordia College (1994) and an MA at the American Institute of Culinary Arts (2002). She was temporarily assigned to the London office from July until November 2008.
  • Steven Buchanan
    Steven Buchanan (71) 555-4848 Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976. Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London. He was promoted to sales manager in March 1993. Mr. Buchanan completed the courses: "Successful Telemarketing" and "International Sales Management." He is fluent in French.
  • Michael Suyama
    Michael Suyama (71) 555-7773 Michael is a graduate of Sussex University (MA, economics, 2001) and the University of California at Los Angeles (MBA, marketing, 2004). He also took the courses "Multi-Cultural Selling" and "Time Management for the Sales Professional." He is fluent in Japanese and can read and write French, Portuguese, and Spanish.
  • Robert King
    Robert King (71) 555-5598 Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992, the year he joined the company. After completing the "Selling in Europe" course, he was transferred to the London office in March 1993.
  • Laura Callahan
    Laura Callahan (206) 555-1189 Laura received a BA degree in psychology from the University of Washington. She also completed a course in business French. She reads and writes French.
  • Anne Dodsworth
    Anne Dodsworth (71) 555-4444 Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German.

The ItemDisplayTemplate property allows you to customize the appearance of List Box items. The property accepts a ListBoxItemDisplayTemplateContext object as the context parameter. You can use the parameter's members to get information about items:

In this demo, the ItemDisplayTemplate property is used to display the ListBox's items in a card-like view. Each item shows an employee's first name, last name, photo, and phone number.

 Column Cell Display Template

Product Unit Price Quantity Discount Total
Queso Cabrales
$14.00
12
0.00%
$168.00
Singaporean Hokkien Fried Mee
$10.00
10
0.00%
$100.00
Mozzarella di Giovanni
$35.00
5
0.00%
$175.00
Tofu
$19.00
9
0.00%
$171.00
Manjimup Dried Apples
$42.00
40
0.00%
$1,680.00
Jack's New England Clam Chowder
$8.00
10
0.00%
$80.00
Manjimup Dried Apples
$42.00
35
15.00%
$1,470.00
Louisiana Fiery Hot Pepper Sauce
$17.00
15
15.00%
$255.00
Gustaf's Knäckebröd
$17.00
6
5.00%
$102.00
Ravioli Angelo
$16.00
15
5.00%
$240.00
Louisiana Fiery Hot Pepper Sauce
$17.00
20
0.00%
$340.00
Sir Rodney's Marmalade
$65.00
40
5.00%
$2,600.00
Geitost
$2.00
25
5.00%
$50.00
Camembert Pierrot
$27.00
40
0.00%
$1,080.00
Gorgonzola Telino
$10.00
20
0.00%
$200.00
Chartreuse verte
$14.00
42
0.00%
$588.00
Maxilaku
$16.00
40
0.00%
$640.00
Guaraná Fantástica
$4.00
15
15.00%
$60.00
Pâté chinois
$19.00
21
15.00%
$399.00
Longlife Tofu
$8.00
21
0.00%
$168.00

The ColumnCellDisplayTemplate property allows you to specify custom content and change the appearance of cells in ListBox columns. The property accepts a ListBoxColumnCellDisplayTemplateContext object as the context parameter. You can use the parameter's members to get information about columns:

This demo customizes the appearance of different columns.

 Empty Data Area Template

  • Loading, please wait...

The DevExpress Blazor ListBox displays an empty data area in the following cases:

  • The Data property is unset.
  • The specified data source does not contain items.
  • You use the DataAsync property or the CustomData property to bind the List Box to a data source. The component sends the first request to a remote data source and waits for a response.

Define the EmptyDataAreaTemplate to customize content displayed in the empty data area. The template's context parameter includes the IsDataLoading property that allows you to determine whether the List Box data is still loading data.