Skip to content

Commit fdda834

Browse files
authored
Merge pull request #4896 from syncfusion-content/BLAZ-910110-multicolumnH1
910110: Update the getting-started-with-web-app.
2 parents eb6b89c + ac41efd commit fdda834

10 files changed

+195
-16
lines changed

blazor-toc.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,6 +3404,8 @@
34043404
<li> <a href="/blazor/multicolumn-combobox/getting-started">Blazor Server and WASM App</a></li>
34053405
</ul>
34063406
</li>
3407+
<li><a href="/blazor/multicolumn-combobox/sorting">Sorting</a></li>
3408+
<li> <a href="/blazor/multicolumn-combobox/virtualization">Virtualization</a></li>
34073409
</ul>
34083410
</li>
34093411
<li>MultiSelect Dropdown
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@using Syncfusion.Blazor
2+
@using Syncfusion.Blazor.MultiColumnComboBox
3+
4+
<SfMultiColumnComboBox TItem="Employee" TValue="string" EnableVirtualization="true" TextField="Name" Width="600px" @bind-Value="@Value" DataSource="@Employees" ValueField="Name" Placeholder="Local Data">
5+
</SfMultiColumnComboBox>
6+
@code {
7+
public class Employee
8+
{
9+
public string Name { get; set; }
10+
public string Department { get; set; }
11+
public string Role { get; set; }
12+
public string Location { get; set; }
13+
public int Experience { get; set; }
14+
}
15+
private string Value { get; set; } = "Alice Johnson";
16+
private List<Employee> Employees = new List<Employee>();
17+
protected override Task OnInitializedAsync()
18+
{
19+
List<Employee> employees = new List<Employee>();
20+
string[] names = { "John Doe", "Jane Smith", "Alice Johnson", "Bob Brown", "Emily Davis" };
21+
string[] departments = { "HR", "IT", "Finance", "Marketing", "Sales" };
22+
string[] roles = { "Manager", "Developer", "Analyst", "Consultant", "Executive" };
23+
string[] locations = { "New York", "San Francisco", "London", "Berlin", "Tokyo" };
24+
Random rand = new Random();
25+
for (int i = 1; i <= 2000; i++)
26+
{
27+
employees.Add(new Employee
28+
{
29+
Name = names[rand.Next(names.Length)],
30+
Department = departments[rand.Next(departments.Length)],
31+
Role = roles[rand.Next(roles.Length)],
32+
Location = locations[rand.Next(locations.Length)],
33+
Experience = rand.Next(1, 21) // Experience between 1 and 20 years
34+
});
35+
}
36+
Employees = employees;
37+
return base.OnInitializedAsync();
38+
}
39+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Syncfusion.Blazor.MultiColumnComboBox
2+
@using Syncfusion.Blazor.Data
3+
4+
<SfMultiColumnComboBox TItem="OrderDetails" TValue="int?" EnableVirtualization="true" ValueField="OrderID" TextField="OrderID" PopupWidth="600px">
5+
<SfDataManager Url="https://blazor.syncfusion.com/services/production/api/Orders" Offline="true" CrossDomain="true" Adaptor="Syncfusion.Blazor.Adaptors.WebApiAdaptor" />
6+
</SfMultiColumnComboBox>
7+
@code {
8+
public Query RemoteQuery = new Query();
9+
public class OrderDetails
10+
{
11+
public int? OrderID { get; set; }
12+
public string CustomerID { get; set; }
13+
public int? EmployeeID { get; set; }
14+
public double? Freight { get; set; }
15+
public string ShipCity { get; set; }
16+
public bool Verified { get; set; }
17+
public DateTime? OrderDate { get; set; }
18+
public string ShipName { get; set; }
19+
public string ShipCountry { get; set; }
20+
public DateTime? ShippedDate { get; set; }
21+
public string ShipAddress { get; set; }
22+
}
23+
}

blazor/multicolumn-combobox/getting-started-with-web-app.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You need to configure the corresponding [Interactive render mode](https://learn.
2323

2424
## Install Syncfusion Blazor MultiColumnComboBox and Themes NuGet in the Blazor Web App
2525

26-
To add **Blazor MultiColumn ComboBox** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.MultiColumnComboBox](https://www.nuget.org/packages/Syncfusion.Blazor.DropDowns/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/).
26+
To add **Blazor MultiColumn ComboBox** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.MultiColumnComboBox](https://www.nuget.org/packages/Syncfusion.Blazor.MultiColumnComboBox/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/).
2727

2828
If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Syncfusion Blazor components NuGet packages within the client project.
2929

@@ -102,11 +102,11 @@ Add the Syncfusion Blazor MultiColumn ComboBox component in `.razor` file inside
102102

103103
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion Blazor MultiColumn ComboBox component in your default web browser.
104104

105-
{% previewsample "https://blazorplayground.syncfusion.com/embed/rtBpNiBuBWhiNjHa?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox Component](./images/blazor-multicolumncombobox-component.png)" %}
105+
{% previewsample "https://blazorplayground.syncfusion.com/embed/hthpNuiEUXUBXNYa?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox Component](./images/blazor-multicolumncombobox-component.png)" %}
106106

107107
## Binding Data Source and Mapping Fields
108108

109-
After initialization, populate the MultiColumn ComboBox with data using the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfDropDownBase-1.html#Syncfusion_Blazor_DropDowns_SfDropDownBase_1_DataSource) property. In this case, the MultiColumn ComboBox binds its DataSource to the Products list, which contains multiple product columns. Both the [ValueField](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) and [TextField](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) properties are set to the Name property of the Product class, ensuring that product names are displayed in the dropdown. The [@bind-Value](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) is used to bind the selected value, with an initial value of "Smart phone" pre-selected in this example.
109+
After initialization, populate the MultiColumn ComboBox with data using the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html#Syncfusion_Blazor_MultiColumnComboBox_SfMultiColumnComboBox_2_DataSource) property. In this case, the MultiColumn ComboBox binds its DataSource to the Products list, which contains multiple product columns. Both the [ValueField](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html#Syncfusion_Blazor_MultiColumnComboBox_SfMultiColumnComboBox_2_ValueField) and [TextField](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html#Syncfusion_Blazor_MultiColumnComboBox_SfMultiColumnComboBox_2_TextField) properties are set to the Name property of the Product class, ensuring that product names are displayed in the dropdown. The [@bind-Value](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) is used to bind the selected value, with an initial value of "Smart phone" pre-selected in this example.
110110

111111
{% tabs %}
112112
{% highlight razor %}
@@ -140,11 +140,11 @@ After initialization, populate the MultiColumn ComboBox with data using the [Dat
140140
{% endhighlight %}
141141
{% endtabs %}
142142

143-
{% previewsample "https://blazorplayground.syncfusion.com/embed/VtBpjsLOhCBHPRgS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Data Binding](./images/blazor-multicolumncombobox-binding-data.png)" %}
143+
{% previewsample "https://blazorplayground.syncfusion.com/embed/hNBJDEWkAXYkTeMy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Data Binding](./images/blazor-multicolumncombobox-binding-data.png)" %}
144144

145145
## Configuring the Columns
146146

147-
The MultiColumn ComboBox supports auto-generating columns, which simplifies the process by automatically creating columns based on the data source. Additionally, you can customize the column header text to reflect specific data, adjust the column [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) for optimal display, and set the [TextAlign](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) (left, center, or right) to enhance readability.
147+
The MultiColumn ComboBox supports auto-generating columns, which simplifies the process by automatically creating columns based on the data source. Additionally, you can customize the column header text to reflect specific data, adjust the column [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.MultiColumnComboboxColumn.html#Syncfusion_Blazor_MultiColumnComboBox_MultiColumnComboboxColumn_Width) for optimal display, and set the [TextAlign](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.MultiColumnComboboxColumn.html#Syncfusion_Blazor_MultiColumnComboBox_MultiColumnComboboxColumn_TextAlign) (left, center, or right) to enhance readability.
148148

149149
{% tabs %}
150150
{% highlight razor %}
@@ -160,11 +160,11 @@ The MultiColumn ComboBox supports auto-generating columns, which simplifies the
160160
{% endhighlight %}
161161
{% endtabs %}
162162

163-
{% previewsample "https://blazorplayground.syncfusion.com/embed/VtBpjsLOhCBHPRgS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Data Binding](./images/blazor-multicolumncombobox-binding-data.png)" %}
163+
{% previewsample "https://blazorplayground.syncfusion.com/embed/rthptYsEgssKVDPs?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Data Binding](./images/blazor-multicolumncombobox-columns.png)" %}
164164

165165
## Configuring the popup list
166166

167-
By default, the width of the popup list automatically adjusts to match the width of the MultiColumn ComboBox input element, and the height is set to `350px`. Both the height and width of the popup list can be customized using the [PopupHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) and [PopupWidth](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html) properties, respectively.
167+
By default, the width of the popup list automatically adjusts to match the width of the MultiColumn ComboBox input element, and the height is set to `350px`. Both the height and width of the popup list can be customized using the [PopupHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html#Syncfusion_Blazor_MultiColumnComboBox_SfMultiColumnComboBox_2_PopupHeight) and [PopupWidth](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.MultiColumnComboBox.SfMultiColumnComboBox-2.html#Syncfusion_Blazor_MultiColumnComboBox_SfMultiColumnComboBox_2_PopupWidth) properties, respectively.
168168

169169
{% tabs %}
170170
{% highlight razor %}
@@ -174,7 +174,7 @@ By default, the width of the popup list automatically adjusts to match the width
174174
{% endhighlight %}
175175
{% endtabs %}
176176

177-
{% previewsample "https://blazorplayground.syncfusion.com/embed/rZBpXirahMIhXWui?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Popup Height and Width in Blazor MultiColumn ComboBox](./images/blazor-multicolumncombobox-popup-customization.png)" %}
177+
{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhJjECYAMdTnsmm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Popup Height and Width in Blazor MultiColumn ComboBox](./images/blazor-multicolumncombobox-popup-customization.png)" %}
178178

179179
N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/ComboBox).
180180

0 commit comments

Comments
 (0)