<EjsListBox Value=@Value DataSource="@Data" TValue="string[]"></EjsListBox>
<style>
.e-listbox-wrapper .e-list-parent {
display: flex;
flex-wrap: wrap;
}
.e-listbox-wrapper .e-list-item {
width: 25%; // adjust the width of the list item based on your need.
}
</style>
@code{
public string[] Value = new string[] { "Hennessey Venom" };
public List<object> Data = new List<object>
{
new { text = "Hennessey Venom", id = "list-01" },
new { text = "Bugatti Chiron", id = "list-02" },
..//
};
} |
<EjsListBox Value=@Value DataSource="@Data" TValue="string[]" CssClass="e-custom"></EjsListBox>
<style>
.e-custom .e-list-parent {
display: flex;
flex-wrap: wrap;
}
.e-custom .e-list-item {
width: 25%;
}
</style> |
<EjsListBox Value=@Value DataSource="@Data" TValue="string[]" CssClass="e-custom">
<ListBoxSelectionSettings ShowCheckbox="true"></ListBoxSelectionSettings>
</EjsListBox>
<style>
.e-listbox-wrapper .e-list-parent {
display: flex;
flex-wrap: wrap;
}
@@media (min-width: 320px) and (max-width:480px) {
.e-custom .e-list-item {
width: 100%;
}
}
@@media (min-width: 480px) and (max-width:780px) {
.e-custom .e-list-item {
width: 50%;
}
}
@@media (min-width: 780px) and (max-width:1920px) {
.e-custom .e-list-item {
width: 25%;
}
}
</style>
|