Hello, I want to create a ListBox with group feature, drag and drop feature. But i would want to have group always visible to user. The group possible depend on which item selected to show the listbox.
Hierarchy :
Category
- Elements
- Operations
--- Elements
Do you have any idea on how to do it ? Or another component which is same design ?
This screen show the ListBox of Operation groupBy Element.Nom (for example : Sol, Corbeilles/poubelles, ...) on the left and on the right a ListBox of Operation without a groupBy and allow DragAndDrop. What I would want is to have Element always show and drag my operation in one of them. Do you have any idea on how to do it ?
Example :
- I drag `Aération des locaux (si possible)` to Element : `Sol`
- The Operation go inside Sol Group.
|
<div id="listbox1">
<h4>Group A</h4>
<SfListBox TValue="string[]" DataSource="@VegetableData" TItem="VegetableDetail" AllowDragAndDrop="true" Scope="combined-list" Height="290px">
<ListBoxFieldSettings GroupBy = "Category" Text="Vegetable" Value="Id" />
</SfListBox>
</div>
<div id="listbox2">
<h4>Group B</h4>
<SfListBox TValue="string[]" DataSource="@GroupB" Scope="combined-list" AllowDragAndDrop="true" Height="290px" TItem="VegetableDetail" @ref="List2">
<ListBoxFieldSettings Text="Vegetable" Value="Id" />
<ListBoxEvents TValue="string[]" TItem="VegetableDetail"></ListBoxEvents>
</SfListBox>
</div>
@code {
public SfListBox<string[], VegetableDetail> List2;
public string groupby = null;
public List<VegetableDetail> VegetableData = new List<VegetableDetail> {
new VegetableDetail{ Vegetable = "Cabbage", Category = "Leafy and Salad", Id = "item1" },
new VegetableDetail{ Vegetable = "Spinach", Category = "Leafy and Salad", Id = "item2" },
};
public List<VegetableDetail> GroupB = new List<VegetableDetail> {
new VegetableDetail{ Vegetable = "Orange", Category = "Beans", Id = "item1" },
new VegetableDetail{ Vegetable = "PineApple", Category = "Beans", Id = "item2" },
new VegetableDetail{ Vegetable = "Apple", Category = "Beans", Id = "item3" },
};
} |