|
| 1 | +@page "/MultiColumn-ComboBox/Default-Functionalities" |
| 2 | + |
| 3 | +@using Syncfusion.Blazor.MultiColumnComboBox |
| 4 | + |
| 5 | +@*Hidden:Lines*@ |
| 6 | +@inherits SampleBaseComponent |
| 7 | +@*End:Hidden*@ |
| 8 | + |
| 9 | +<SampleDescription> |
| 10 | + <p>This example demonstrates the primary features of the <a href="https://www.syncfusion.com/blazor-components/blazor-multicolumn-combobox" aria-label="Feature Tour of Blazor MultiColumn ComboBox">Blazor MultiColumn ComboBox</a>. You can type into the ComboBox or click the dropdown icon to choose an item from multiple columns.</p> |
| 11 | +</SampleDescription> |
| 12 | +<ActionDescription> |
| 13 | + <p>The MultiColumn ComboBox allows users to either input a value or select from a list that is organized into multiple columns.</p> |
| 14 | + <p><b>See also</b></p> |
| 15 | + <ul> |
| 16 | + <li><a href="https://blazor.syncfusion.com/documentation/multicolumn-combobox/getting-started/" target="_blank" aria-label="Blazor MultiColumn ComboBox Getting Started documentation">Getting Started with Blazor MultiColumn ComboBox</a></li> |
| 17 | + </ul> |
| 18 | +</ActionDescription> |
| 19 | + |
| 20 | +<div class="col-lg-12"> |
| 21 | + <div class="col-lg-8 control-section sb-property-border"> |
| 22 | + <div class="control-wrapper"> |
| 23 | + <label class="example-label">Select a product</label> |
| 24 | + <SfMultiColumnComboBox @bind-Value="@Value" DataSource="@Products" PopupWidth="600px" ValueField="Name" TextField="Name" Placeholder="Select any product"></SfMultiColumnComboBox> |
| 25 | + </div> |
| 26 | + </div> |
| 27 | + <div class="col-lg-4"> |
| 28 | + <div class="property-panel-section"> |
| 29 | + <div class="property-panel-header">Properties</div> |
| 30 | + <div class="property-panel-content"> |
| 31 | + <div class="property-value">Selected Value : <b>@Value</b></div> |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | +</div> |
| 36 | + |
| 37 | +<style> |
| 38 | + .control-section { |
| 39 | + min-height: 370px; |
| 40 | + } |
| 41 | +
|
| 42 | + .control-wrapper { |
| 43 | + max-width: 250px; |
| 44 | + margin: 0 auto; |
| 45 | + padding: 50px 0px 0px; |
| 46 | + } |
| 47 | +
|
| 48 | + .example-label { |
| 49 | + font-size: 14px; |
| 50 | + margin-bottom: 6px; |
| 51 | + } |
| 52 | +
|
| 53 | + .property-panel-section .property-value { |
| 54 | + padding: 5px 0px 10px; |
| 55 | + font-size: 14px; |
| 56 | + } |
| 57 | +
|
| 58 | + .property-panel-content { |
| 59 | + padding: 0px 0px 15px 0px; |
| 60 | + } |
| 61 | +
|
| 62 | + .property-panel-content:last-child { |
| 63 | + padding: 0px 0px 40px 0px; |
| 64 | + } |
| 65 | +</style> |
| 66 | + |
| 67 | +@code { |
| 68 | + |
| 69 | + public class Product |
| 70 | + { |
| 71 | + public string Name { get; set; } |
| 72 | + public decimal Price { get; set; } |
| 73 | + public string Availability { get; set; } |
| 74 | + public string Category { get; set; } |
| 75 | + public double Rating { get; set; } |
| 76 | + } |
| 77 | + |
| 78 | + private List<Product> Products = new List<Product>(); |
| 79 | + |
| 80 | + private string Value { get; set; } = "Smartphone"; |
| 81 | + |
| 82 | + protected override Task OnInitializedAsync() |
| 83 | + { |
| 84 | + Products = new List<Product> |
| 85 | + { |
| 86 | + new Product { Name = "Laptop", Price = 999.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.5 }, |
| 87 | + new Product { Name = "Smartphone", Price = 599.99m, Availability = "Out of Stock", Category = "Electronics", Rating = 4.3 }, |
| 88 | + new Product { Name = "Tablet", Price = 299.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.2 }, |
| 89 | + new Product { Name = "Headphones", Price = 49.99m, Availability = "In Stock", Category = "Accessories", Rating = 4.0 }, |
| 90 | + new Product { Name = "Smartwatch", Price = 199.99m, Availability = "Limited Stock", Category = "Wearables", Rating = 4.4 }, |
| 91 | + new Product { Name = "Monitor", Price = 129.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.6 }, |
| 92 | + new Product { Name = "Keyboard", Price = 39.99m, Availability = "In Stock", Category = "Accessories", Rating = 4.1 }, |
| 93 | + new Product { Name = "Mouse", Price = 19.99m, Availability = "Out of Stock", Category = "Accessories", Rating = 4.3 }, |
| 94 | + new Product { Name = "Printer", Price = 89.99m, Availability = "In Stock", Category = "Office Supplies", Rating = 4.2 }, |
| 95 | + new Product { Name = "Camera", Price = 499.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.7 }, |
| 96 | + new Product { Name = "Speakers", Price = 149.99m, Availability = "In Stock", Category = "Accessories", Rating = 4.5 }, |
| 97 | + new Product { Name = "Router", Price = 79.99m, Availability = "Out of Stock", Category = "Electronics", Rating = 4.4 }, |
| 98 | + new Product { Name = "External Hard Drive", Price = 59.99m, Availability = "In Stock", Category = "Storage", Rating = 4.6 }, |
| 99 | + new Product { Name = "USB Flash Drive", Price = 9.99m, Availability = "In Stock", Category = "Storage", Rating = 4.2 }, |
| 100 | + new Product { Name = "Webcam", Price = 29.99m, Availability = "Limited Stock", Category = "Accessories", Rating = 4.1 }, |
| 101 | + new Product { Name = "Smart TV", Price = 799.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.8 }, |
| 102 | + new Product { Name = "Projector", Price = 299.99m, Availability = "Out of Stock", Category = "Electronics", Rating = 4.5 }, |
| 103 | + new Product { Name = "VR Headset", Price = 349.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.7 }, |
| 104 | + new Product { Name = "Drone", Price = 599.99m, Availability = "In Stock", Category = "Electronics", Rating = 4.6 }, |
| 105 | + new Product { Name = "Fitness Tracker", Price = 99.99m, Availability = "In Stock", Category = "Wearables", Rating = 4.3 } |
| 106 | + }; |
| 107 | + return base.OnInitializedAsync(); |
| 108 | + } |
| 109 | +} |
0 commit comments