- Antarctica
- United Arab Emirates
- Afghanistan
- Albania
- Armenia
- Curacao
- Sint Maarten
- Netherlands Antilles
- Angola
- Argentina
- Australia
- Cocos Islands
- Christmas Island
- Heard Island and McDonald Islands
- Kiribati
- Norfolk Island
- Nauru
- Tuvalu
- Aruba
- Azerbaijan
- Bosnia and Herzegovina
- Barbados
- Bangladesh
- Bulgaria
- Bahrain
- Burundi
- Bermuda
- Brunei
- Bolivia
- Brazil
- Bahamas
- Bhutan
- Botswana
- Belarus
- Belize
- Canada
- Democratic Republic of the Congo
- Switzerland
- Liechtenstein
- Chile
- China
- Colombia
- Costa Rica
- Cuba
- Cape Verde
- Czech Republic
- Djibouti
- Denmark
- Faroe Islands
- Greenland
- Dominican Republic
- Algeria
- Egypt
- Eritrea
- Ethiopia
- Andorra
- Austria
- Aland Islands
- Belgium
- Saint Barthelemy
- Cyprus
- Germany
- Estonia
- Spain
- Finland
- France
- French Guiana
- Guadeloupe
- Greece
- Ireland
- Italy
- Kosovo
- Luxembourg
- Monaco
- Montenegro
- Saint Martin
- Martinique
- Malta
- Netherlands
- Saint Pierre and Miquelon
- Portugal
- Reunion
- Slovenia
- Slovakia
- San Marino
- French Southern Territories
- Vatican
- Mayotte
- Fiji
- Falkland Islands
- United Kingdom
- Guernsey
- South Georgia and the South Sandwich Islands
- Isle of Man
- Jersey
- Georgia
- Ghana
- Gibraltar
- Gambia
- Guinea
- Guatemala
- Guyana
- Hong Kong
- Honduras
- Croatia
- Haiti
- Hungary
- Indonesia
- Israel
- Palestinian Territory
- India
- Iraq
- Iran
- Iceland
- Jamaica
- Jordan
- Japan
- Kenya
- Kyrgyzstan
- Cambodia
- Comoros
- North Korea
- South Korea
- Kuwait
- Cayman Islands
- Kazakhstan
- Laos
- Lebanon
- Sri Lanka
- Liberia
- Lesotho
- Lithuania
- Latvia
- Libya
- Western Sahara
- Morocco
- Moldova
- Madagascar
- Macedonia
- Myanmar
- Mongolia
- Macao
- Mauritania
- Mauritius
- Maldives
- Malawi
- Mexico
- Malaysia
- Mozambique
- Namibia
- Nigeria
- Nicaragua
- Bouvet Island
- Norway
- Svalbard and Jan Mayen
- Nepal
- Cook Islands
- Niue
- New Zealand
- Pitcairn
- Tokelau
- Oman
- Panama
- Peru
- Papua New Guinea
- Philippines
- Pakistan
- Poland
- Paraguay
- Qatar
- Romania
- Serbia
- Serbia and Montenegro
- Russia
- Rwanda
- Saudi Arabia
- Solomon Islands
- Seychelles
- Sudan
- Sweden
- Singapore
- Saint Helena
- Sierra Leone
- Somalia
- Suriname
- South Sudan
- Sao Tome and Principe
- Syria
- Swaziland
- Thailand
- Tajikistan
- Turkmenistan
- Tunisia
- Tonga
- Turkey
- Trinidad and Tobago
- Taiwan
- Tanzania
- Ukraine
- Uganda
- American Samoa
- Bonaire, Saint Eustatius and Saba
- Ecuador
- Micronesia
- Guam
- British Indian Ocean Territory
- Marshall Islands
- Northern Mariana Islands
- Puerto Rico
- Palau
- El Salvador
- Turks and Caicos Islands
- East Timor
- United States Minor Outlying Islands
- United States
- British Virgin Islands
- U.S. Virgin Islands
- Uruguay
- Uzbekistan
- Venezuela
- Vietnam
- Vanuatu
- Samoa
- Central African Republic
- Republic of the Congo
- Cameroon
- Gabon
- Equatorial Guinea
- Chad
- Antigua and Barbuda
- Anguilla
- Dominica
- Grenada
- Saint Kitts and Nevis
- Saint Lucia
- Montserrat
- Saint Vincent and the Grenadines
- Burkina Faso
- Benin
- Ivory Coast
- Guinea-Bissau
- Mali
- Niger
- Senegal
- Togo
- New Caledonia
- French Polynesia
- Wallis and Futuna
- Yemen
- South Africa
- Zambia
- Zimbabwe
Blazorise List View component
List views are a flexible and powerful component for displaying a series of content in a contained scrollable view by providing a data source.
    List views use ListGroup behind the covers, so you may make use of the ListGroup underlying APIs.
Examples
Basic
<ListView TItem="Country" Data="Countries" TextField="(item) => item.Name" ValueField="(item) => item.Iso" Mode="ListGroupMode.Static" MaxHeight="300px"> </ListView>
@code { [Inject] public CountryData CountryData { get; set; } public IEnumerable<Country> Countries; protected override async Task OnInitializedAsync() { Countries = await CountryData.GetDataAsync(); await base.OnInitializedAsync(); } }
Selectable items
Set theListView Mode to ListGroupMode.Selectable.
        Bind SelectedItem and provide TextField to setup the display text and ValueField to uniquely identify the current active selection.
    - Antarctica
- United Arab Emirates
- Afghanistan
- Albania
- Armenia
- Curacao
- Sint Maarten
- Netherlands Antilles
- Angola
- Argentina
- Australia
- Cocos Islands
- Christmas Island
- Heard Island and McDonald Islands
- Kiribati
- Norfolk Island
- Nauru
- Tuvalu
- Aruba
- Azerbaijan
- Bosnia and Herzegovina
- Barbados
- Bangladesh
- Bulgaria
- Bahrain
- Burundi
- Bermuda
- Brunei
- Bolivia
- Brazil
- Bahamas
- Bhutan
- Botswana
- Belarus
- Belize
- Canada
- Democratic Republic of the Congo
- Switzerland
- Liechtenstein
- Chile
- China
- Colombia
- Costa Rica
- Cuba
- Cape Verde
- Czech Republic
- Djibouti
- Denmark
- Faroe Islands
- Greenland
- Dominican Republic
- Algeria
- Egypt
- Eritrea
- Ethiopia
- Andorra
- Austria
- Aland Islands
- Belgium
- Saint Barthelemy
- Cyprus
- Germany
- Estonia
- Spain
- Finland
- France
- French Guiana
- Guadeloupe
- Greece
- Ireland
- Italy
- Kosovo
- Luxembourg
- Monaco
- Montenegro
- Saint Martin
- Martinique
- Malta
- Netherlands
- Saint Pierre and Miquelon
- Portugal
- Reunion
- Slovenia
- Slovakia
- San Marino
- French Southern Territories
- Vatican
- Mayotte
- Fiji
- Falkland Islands
- United Kingdom
- Guernsey
- South Georgia and the South Sandwich Islands
- Isle of Man
- Jersey
- Georgia
- Ghana
- Gibraltar
- Gambia
- Guinea
- Guatemala
- Guyana
- Hong Kong
- Honduras
- Croatia
- Haiti
- Hungary
- Indonesia
- Israel
- Palestinian Territory
- India
- Iraq
- Iran
- Iceland
- Jamaica
- Jordan
- Japan
- Kenya
- Kyrgyzstan
- Cambodia
- Comoros
- North Korea
- South Korea
- Kuwait
- Cayman Islands
- Kazakhstan
- Laos
- Lebanon
- Sri Lanka
- Liberia
- Lesotho
- Lithuania
- Latvia
- Libya
- Western Sahara
- Morocco
- Moldova
- Madagascar
- Macedonia
- Myanmar
- Mongolia
- Macao
- Mauritania
- Mauritius
- Maldives
- Malawi
- Mexico
- Malaysia
- Mozambique
- Namibia
- Nigeria
- Nicaragua
- Bouvet Island
- Norway
- Svalbard and Jan Mayen
- Nepal
- Cook Islands
- Niue
- New Zealand
- Pitcairn
- Tokelau
- Oman
- Panama
- Peru
- Papua New Guinea
- Philippines
- Pakistan
- Poland
- Paraguay
- Qatar
- Romania
- Serbia
- Serbia and Montenegro
- Russia
- Rwanda
- Saudi Arabia
- Solomon Islands
- Seychelles
- Sudan
- Sweden
- Singapore
- Saint Helena
- Sierra Leone
- Somalia
- Suriname
- South Sudan
- Sao Tome and Principe
- Syria
- Swaziland
- Thailand
- Tajikistan
- Turkmenistan
- Tunisia
- Tonga
- Turkey
- Trinidad and Tobago
- Taiwan
- Tanzania
- Ukraine
- Uganda
- American Samoa
- Bonaire, Saint Eustatius and Saba
- Ecuador
- Micronesia
- Guam
- British Indian Ocean Territory
- Marshall Islands
- Northern Mariana Islands
- Puerto Rico
- Palau
- El Salvador
- Turks and Caicos Islands
- East Timor
- United States Minor Outlying Islands
- United States
- British Virgin Islands
- U.S. Virgin Islands
- Uruguay
- Uzbekistan
- Venezuela
- Vietnam
- Vanuatu
- Samoa
- Central African Republic
- Republic of the Congo
- Cameroon
- Gabon
- Equatorial Guinea
- Chad
- Antigua and Barbuda
- Anguilla
- Dominica
- Grenada
- Saint Kitts and Nevis
- Saint Lucia
- Montserrat
- Saint Vincent and the Grenadines
- Burkina Faso
- Benin
- Ivory Coast
- Guinea-Bissau
- Mali
- Niger
- Senegal
- Togo
- New Caledonia
- French Polynesia
- Wallis and Futuna
- Yemen
- South Africa
- Zambia
- Zimbabwe
<ListView TItem="Country" Data="Countries" TextField="(item) => item.Name" ValueField="(item) => item.Iso" Mode="ListGroupMode.Selectable" MaxHeight="300px" @bind-SelectedItem=""> </ListView> <Field Horizontal> <FieldBody ColumnSize="ColumnSize.Is12"> Selected Item: @selectedListViewItem?.Name </FieldBody> </Field>
@code { [Inject] public CountryData CountryData { get; set; } public IEnumerable<Country> Countries; private Country selectedListViewItem; protected override async Task OnInitializedAsync() { Countries = await CountryData.GetDataAsync(); await base.OnInitializedAsync(); } }
Extending with custom item content
Customize the way you display theListView items by providing ItemTemplate.
    - AQ- Antarctica 
- AEAbu Dhabi- United Arab Emirates 
- AFKabul- Afghanistan 
- ALTirana- Albania 
- AMYerevan- Armenia 
- CWWillemstad- Curacao 
- SXPhilipsburg- Sint Maarten 
- ANWillemstad- Netherlands Antilles 
- AOLuanda- Angola 
- ARBuenos Aires- Argentina 
- AUCanberra- Australia 
- CCWest Island- Cocos Islands 
- CXFlying Fish Cove- Christmas Island 
- HM- Heard Island and McDonald Islands 
- KITarawa- Kiribati 
- NFKingston- Norfolk Island 
- NRYaren- Nauru 
- TVFunafuti- Tuvalu 
- AWOranjestad- Aruba 
- AZBaku- Azerbaijan 
- BASarajevo- Bosnia and Herzegovina 
- BBBridgetown- Barbados 
- BDDhaka- Bangladesh 
- BGSofia- Bulgaria 
- BHManama- Bahrain 
- BIBujumbura- Burundi 
- BMHamilton- Bermuda 
- BNBandar Seri Begawan- Brunei 
- BOSucre- Bolivia 
- BRBrasilia- Brazil 
- BSNassau- Bahamas 
- BTThimphu- Bhutan 
- BWGaborone- Botswana 
- BYMinsk- Belarus 
- BZBelmopan- Belize 
- CAOttawa- Canada 
- CDKinshasa- Democratic Republic of the Congo 
- CHBerne- Switzerland 
- LIVaduz- Liechtenstein 
- CLSantiago- Chile 
- CNBeijing- China 
- COBogota- Colombia 
- CRSan Jose- Costa Rica 
- CUHavana- Cuba 
- CVPraia- Cape Verde 
- CZPrague- Czech Republic 
- DJDjibouti- Djibouti 
- DKCopenhagen- Denmark 
- FOTorshavn- Faroe Islands 
- GLNuuk- Greenland 
- DOSanto Domingo- Dominican Republic 
- DZAlgiers- Algeria 
- EGCairo- Egypt 
- ERAsmara- Eritrea 
- ETAddis Ababa- Ethiopia 
- ADAndorra la Vella- Andorra 
- ATVienna- Austria 
- AXMariehamn- Aland Islands 
- BEBrussels- Belgium 
- BLGustavia- Saint Barthelemy 
- CYNicosia- Cyprus 
- DEBerlin- Germany 
- EETallinn- Estonia 
- ESMadrid- Spain 
- FIHelsinki- Finland 
- FRParis- France 
- GFCayenne- French Guiana 
- GPBasse-Terre- Guadeloupe 
- GRAthens- Greece 
- IEDublin- Ireland 
- ITRome- Italy 
- XKPristina- Kosovo 
- LULuxembourg- Luxembourg 
- MCMonaco- Monaco 
- MEPodgorica- Montenegro 
- MFMarigot- Saint Martin 
- MQFort-de-France- Martinique 
- MTValletta- Malta 
- NLAmsterdam- Netherlands 
- PMSaint-Pierre- Saint Pierre and Miquelon 
- PTLisbon- Portugal 
- RESaint-Denis- Reunion 
- SILjubljana- Slovenia 
- SKBratislava- Slovakia 
- SMSan Marino- San Marino 
- TFPort-aux-Francais- French Southern Territories 
- VAVatican City- Vatican 
- YTMamoudzou- Mayotte 
- FJSuva- Fiji 
- FKStanley- Falkland Islands 
- GBLondon- United Kingdom 
- GGSt Peter Port- Guernsey 
- GSGrytviken- South Georgia and the South Sandwich Islands 
- IMDouglas, Isle of Man- Isle of Man 
- JESaint Helier- Jersey 
- GETbilisi- Georgia 
- GHAccra- Ghana 
- GIGibraltar- Gibraltar 
- GMBanjul- Gambia 
- GNConakry- Guinea 
- GTGuatemala City- Guatemala 
- GYGeorgetown- Guyana 
- HKHong Kong- Hong Kong 
- HNTegucigalpa- Honduras 
- HRZagreb- Croatia 
- HTPort-au-Prince- Haiti 
- HUBudapest- Hungary 
- IDJakarta- Indonesia 
- ILJerusalem- Israel 
- PSEast Jerusalem- Palestinian Territory 
- INNew Delhi- India 
- IQBaghdad- Iraq 
- IRTehran- Iran 
- ISReykjavik- Iceland 
- JMKingston- Jamaica 
- JOAmman- Jordan 
- JPTokyo- Japan 
- KENairobi- Kenya 
- KGBishkek- Kyrgyzstan 
- KHPhnom Penh- Cambodia 
- KMMoroni- Comoros 
- KPPyongyang- North Korea 
- KRSeoul- South Korea 
- KWKuwait City- Kuwait 
- KYGeorge Town- Cayman Islands 
- KZAstana- Kazakhstan 
- LAVientiane- Laos 
- LBBeirut- Lebanon 
- LKColombo- Sri Lanka 
- LRMonrovia- Liberia 
- LSMaseru- Lesotho 
- LTVilnius- Lithuania 
- LVRiga- Latvia 
- LYTripolis- Libya 
- EHEl-Aaiun- Western Sahara 
- MARabat- Morocco 
- MDChisinau- Moldova 
- MGAntananarivo- Madagascar 
- MKSkopje- Macedonia 
- MMNay Pyi Taw- Myanmar 
- MNUlan Bator- Mongolia 
- MOMacao- Macao 
- MRNouakchott- Mauritania 
- MUPort Louis- Mauritius 
- MVMale- Maldives 
- MWLilongwe- Malawi 
- MXMexico City- Mexico 
- MYKuala Lumpur- Malaysia 
- MZMaputo- Mozambique 
- NAWindhoek- Namibia 
- NGAbuja- Nigeria 
- NIManagua- Nicaragua 
- BV- Bouvet Island 
- NOOslo- Norway 
- SJLongyearbyen- Svalbard and Jan Mayen 
- NPKathmandu- Nepal 
- CKAvarua- Cook Islands 
- NUAlofi- Niue 
- NZWellington- New Zealand 
- PNAdamstown- Pitcairn 
- TK- Tokelau 
- OMMuscat- Oman 
- PAPanama City- Panama 
- PELima- Peru 
- PGPort Moresby- Papua New Guinea 
- PHManila- Philippines 
- PKIslamabad- Pakistan 
- PLWarsaw- Poland 
- PYAsuncion- Paraguay 
- QADoha- Qatar 
- ROBucharest- Romania 
- RSBelgrade- Serbia 
- CSBelgrade- Serbia and Montenegro 
- RUMoscow- Russia 
- RWKigali- Rwanda 
- SARiyadh- Saudi Arabia 
- SBHoniara- Solomon Islands 
- SCVictoria- Seychelles 
- SDKhartoum- Sudan 
- SEStockholm- Sweden 
- SGSingapur- Singapore 
- SHJamestown- Saint Helena 
- SLFreetown- Sierra Leone 
- SOMogadishu- Somalia 
- SRParamaribo- Suriname 
- SSJuba- South Sudan 
- STSao Tome- Sao Tome and Principe 
- SYDamascus- Syria 
- SZMbabane- Swaziland 
- THBangkok- Thailand 
- TJDushanbe- Tajikistan 
- TMAshgabat- Turkmenistan 
- TNTunis- Tunisia 
- TONuku'alofa- Tonga 
- TRAnkara- Turkey 
- TTPort of Spain- Trinidad and Tobago 
- TWTaipei- Taiwan 
- TZDodoma- Tanzania 
- UAKiev- Ukraine 
- UGKampala- Uganda 
- ASPago Pago- American Samoa 
- BQ- Bonaire, Saint Eustatius and Saba 
- ECQuito- Ecuador 
- FMPalikir- Micronesia 
- GUHagatna- Guam 
- IODiego Garcia- British Indian Ocean Territory 
- MHMajuro- Marshall Islands 
- MPSaipan- Northern Mariana Islands 
- PRSan Juan- Puerto Rico 
- PWMelekeok- Palau 
- SVSan Salvador- El Salvador 
- TCCockburn Town- Turks and Caicos Islands 
- TLDili- East Timor 
- UM- United States Minor Outlying Islands 
- USWashington- United States 
- VGRoad Town- British Virgin Islands 
- VICharlotte Amalie- U.S. Virgin Islands 
- UYMontevideo- Uruguay 
- UZTashkent- Uzbekistan 
- VECaracas- Venezuela 
- VNHanoi- Vietnam 
- VUPort Vila- Vanuatu 
- WSApia- Samoa 
- CFBangui- Central African Republic 
- CGBrazzaville- Republic of the Congo 
- CMYaounde- Cameroon 
- GALibreville- Gabon 
- GQMalabo- Equatorial Guinea 
- TDN'Djamena- Chad 
- AGSt. John's- Antigua and Barbuda 
- AIThe Valley- Anguilla 
- DMRoseau- Dominica 
- GDSt. George's- Grenada 
- KNBasseterre- Saint Kitts and Nevis 
- LCCastries- Saint Lucia 
- MSPlymouth- Montserrat 
- VCKingstown- Saint Vincent and the Grenadines 
- BFOuagadougou- Burkina Faso 
- BJPorto-Novo- Benin 
- CIYamoussoukro- Ivory Coast 
- GWBissau- Guinea-Bissau 
- MLBamako- Mali 
- NENiamey- Niger 
- SNDakar- Senegal 
- TGLome- Togo 
- NCNoumea- New Caledonia 
- PFPapeete- French Polynesia 
- WFMata Utu- Wallis and Futuna 
- YESanaa- Yemen 
- ZAPretoria- South Africa 
- ZMLusaka- Zambia 
- ZWHarare- Zimbabwe 
<ListView TItem="Country" Data="Countries" TextField="(item) => item.Name" ValueField="(item) => item.Iso" Mode="ListGroupMode.Static" MaxHeight="300px"> <ItemTemplate> <Div Flex="Flex.InlineFlex.JustifyContent.Between" Width="Width.Is100"> <Heading Margin="Margin.Is2.FromBottom">@context.Item.Iso</Heading> <Small>@context.Item.Capital</Small> </Div> <Paragraph Margin="Margin.Is2.FromBottom">@context.Text</Paragraph> </ItemTemplate> </ListView>
@code { [Inject] public CountryData CountryData { get; set; } public IEnumerable<Country> Countries; protected override async Task OnInitializedAsync() { Countries = await CountryData.GetDataAsync(); await base.OnInitializedAsync(); } }
Styling Individual Items
Customize the look of each item by using the right callbacks.- Antarctica
- United Arab Emirates
- Afghanistan
- Albania
- Armenia
- Curacao
- Sint Maarten
- Netherlands Antilles
- Angola
- Argentina
- Australia
- Cocos Islands
- Christmas Island
- Heard Island and McDonald Islands
- Kiribati
- Norfolk Island
- Nauru
- Tuvalu
- Aruba
- Azerbaijan
- Bosnia and Herzegovina
- Barbados
- Bangladesh
- Bulgaria
- Bahrain
- Burundi
- Bermuda
- Brunei
- Bolivia
- Brazil
- Bahamas
- Bhutan
- Botswana
- Belarus
- Belize
- Canada
- Democratic Republic of the Congo
- Switzerland
- Liechtenstein
- Chile
- China
- Colombia
- Costa Rica
- Cuba
- Cape Verde
- Czech Republic
- Djibouti
- Denmark
- Faroe Islands
- Greenland
- Dominican Republic
- Algeria
- Egypt
- Eritrea
- Ethiopia
- Andorra
- Austria
- Aland Islands
- Belgium
- Saint Barthelemy
- Cyprus
- Germany
- Estonia
- Spain
- Finland
- France
- French Guiana
- Guadeloupe
- Greece
- Ireland
- Italy
- Kosovo
- Luxembourg
- Monaco
- Montenegro
- Saint Martin
- Martinique
- Malta
- Netherlands
- Saint Pierre and Miquelon
- Portugal
- Reunion
- Slovenia
- Slovakia
- San Marino
- French Southern Territories
- Vatican
- Mayotte
- Fiji
- Falkland Islands
- United Kingdom
- Guernsey
- South Georgia and the South Sandwich Islands
- Isle of Man
- Jersey
- Georgia
- Ghana
- Gibraltar
- Gambia
- Guinea
- Guatemala
- Guyana
- Hong Kong
- Honduras
- Croatia
- Haiti
- Hungary
- Indonesia
- Israel
- Palestinian Territory
- India
- Iraq
- Iran
- Iceland
- Jamaica
- Jordan
- Japan
- Kenya
- Kyrgyzstan
- Cambodia
- Comoros
- North Korea
- South Korea
- Kuwait
- Cayman Islands
- Kazakhstan
- Laos
- Lebanon
- Sri Lanka
- Liberia
- Lesotho
- Lithuania
- Latvia
- Libya
- Western Sahara
- Morocco
- Moldova
- Madagascar
- Macedonia
- Myanmar
- Mongolia
- Macao
- Mauritania
- Mauritius
- Maldives
- Malawi
- Mexico
- Malaysia
- Mozambique
- Namibia
- Nigeria
- Nicaragua
- Bouvet Island
- Norway
- Svalbard and Jan Mayen
- Nepal
- Cook Islands
- Niue
- New Zealand
- Pitcairn
- Tokelau
- Oman
- Panama
- Peru
- Papua New Guinea
- Philippines
- Pakistan
- Poland
- Paraguay
- Qatar
- Romania
- Serbia
- Serbia and Montenegro
- Russia
- Rwanda
- Saudi Arabia
- Solomon Islands
- Seychelles
- Sudan
- Sweden
- Singapore
- Saint Helena
- Sierra Leone
- Somalia
- Suriname
- South Sudan
- Sao Tome and Principe
- Syria
- Swaziland
- Thailand
- Tajikistan
- Turkmenistan
- Tunisia
- Tonga
- Turkey
- Trinidad and Tobago
- Taiwan
- Tanzania
- Ukraine
- Uganda
- American Samoa
- Bonaire, Saint Eustatius and Saba
- Ecuador
- Micronesia
- Guam
- British Indian Ocean Territory
- Marshall Islands
- Northern Mariana Islands
- Puerto Rico
- Palau
- El Salvador
- Turks and Caicos Islands
- East Timor
- United States Minor Outlying Islands
- United States
- British Virgin Islands
- U.S. Virgin Islands
- Uruguay
- Uzbekistan
- Venezuela
- Vietnam
- Vanuatu
- Samoa
- Central African Republic
- Republic of the Congo
- Cameroon
- Gabon
- Equatorial Guinea
- Chad
- Antigua and Barbuda
- Anguilla
- Dominica
- Grenada
- Saint Kitts and Nevis
- Saint Lucia
- Montserrat
- Saint Vincent and the Grenadines
- Burkina Faso
- Benin
- Ivory Coast
- Guinea-Bissau
- Mali
- Niger
- Senegal
- Togo
- New Caledonia
- French Polynesia
- Wallis and Futuna
- Yemen
- South Africa
- Zambia
- Zimbabwe
@using System.Linq <ListView TItem="Country" Data="Countries" TextField="(item) => item.Name" ValueField="(item) => item.Iso" Mode="ListGroupMode.Selectable" MaxHeight="300px" ItemTextColor="((item) => Countries.IndexOf( item ) % 2 == 0 ? TextColor.Danger : TextColor.Success)" ItemBackground="(item) => Background.Default" ItemPadding="(item) => Padding.Is4" ItemClass="@((item) => $"country-{item.Iso}")" ItemStyle="@((item) => "border: 1px solid red")" @bind-SelectedItem=""> </ListView> <Field Horizontal> <FieldBody ColumnSize="ColumnSize.Is12"> Selected Item: @selectedListViewItem?.Name </FieldBody> </Field>
@code { [Inject] public CountryData CountryData { get; set; } public List<Country> Countries; private Country selectedListViewItem; protected override async Task OnInitializedAsync() { Countries = (await CountryData.GetDataAsync()).ToList(); await base.OnInitializedAsync(); } }
API
Parameters
| Parameter | Description | Type | Default | 
|---|---|---|---|
| Attributes | Captures all the custom attribute that are not part of Blazorise component. | Dictionary<string, object> | null | 
| ChildContent | Specifies the content to be rendered inside this Components.ListView. | RenderFragment | null | 
| Class | Custom css class-names. | string | |
| Data | Gets or sets the items data-source. | IEnumerable<TItem> | null | 
| Flush | Remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards). | bool | false | 
| Height | Sets the ListView Height. Defaults to empty. | string | |
| ItemTemplate | Specifies the content to be rendered inside each item of the Components.ListView. | RenderFragment<ItemContext<TItem>> | null | 
| MaxHeight | Sets the ListView MaxHeight. Defaults to 250px. | string | "250px" | 
| Mode | Defines the list-group behavior mode. Possible values: | ListGroupMode | Static | 
| Scrollable | Makes the list group scrollable by adding a vertical scrollbar. | bool | true | 
| SelectedItem | Currently selected item. | TItem | null | 
| SelectedItems | Currently selected items. | List<TItem> | null | 
| SelectionMode | Defines the list-group selection mode. Possible values: | ListGroupSelectionMode | Single | 
| Style | Custom styles. | string | |
| Virtualize | Gets or sets whether the listview will use the Virtualize functionality. | bool | false | 
Events
| Event | Description | Type | 
|---|---|---|
| DisabledItem | Method used to get the disabled items from the supplied data source. | Func<TItem, bool> | 
| ItemBackground | Method used to get the background color for the item. | Func<TItem, Background> | 
| ItemClass | Method used to get the class for the item. | Func<TItem, string> | 
| ItemMargin | Method used to get the margin for the item. | Func<TItem, IFluentSpacing> | 
| ItemPadding | Method used to get the padding for the item. | Func<TItem, IFluentSpacing> | 
| ItemStyle | Method used to get the style for the item. | Func<TItem, string> | 
| ItemTextColor | Method used to get the text color for the item. | Func<TItem, TextColor> | 
| SelectedItemChanged | Occurs after the selected item has changed. | EventCallback<TItem> | 
| SelectedItemsChanged | Occurs after the selected items has changed. | EventCallback<List<TItem>> | 
| TextField | Method used to get the display field from the supplied data source. | Func<TItem, string> | 
| ValueField | Method used to get the value field from the supplied data source. | Func<TItem, string> |