Hello
i'm working with Dual ListBox and I cannot get the data from the 2nd list to save them in the DB
Here is an example of what I do
I tried to used what is demonstrated here https://www.syncfusion.com/forums/157457/how-to-get-all-selected-items-in-a-list-box with no luck
The code is here
DataSource="@projectListSource" Scope="scope2"
TItem="Project" @attributes="listbox1Attr">
DataSource="@projectListTarget"
TItem="Project"
@bind-Value="@projects"
@attributes="listbox2Attr">
When I use the bind-Value nothing is inserted in @projects !
My variable init is
public string[] projects = new string[] {"","","" };
If I had 4 blank it loops 3 times but does not retrieve the 3 elements. If i init with 0 it fails
Any helps is much appreciated
Regards
<SfListBox Scope="@scope2" DataSource="@groupA" TItem="ListItem" Height="330px" TValue="string[]" @attributes="listbox1Attr" @bind-Value="@projects">
<ListBoxFieldSettings Text="Name" Value="Name"></ListBoxFieldSettings>
<ListBoxToolbarSettings Items="@items"></ListBoxToolbarSettings>
<ListBoxTemplates TItem="ListItem">
<NoRecordsTemplate>
<span>NO DATA AVAILABLE</span>
</NoRecordsTemplate>
</ListBoxTemplates>
</SfListBox>
</div>
<div class="dual-list-groupb">
<h4>Group B</h4>
<SfListBox Scope="@scope1" DataSource="@groupB" Height="330px" TItem="ListItem" TValue="string[]" @attributes="listbox2Attr">
<ListBoxFieldSettings Text="Name" Value="Code"></ListBoxFieldSettings>
<ListBoxTemplates TItem="ListItem">
<NoRecordsTemplate>
<span>NO DATA AVAILABLE</span>
</NoRecordsTemplate>
</ListBoxTemplates>
</SfListBox>
@code
{
public string[] projects = new string[] { "", "Australia","Germany","France" };
} |
Hi
thank you for your sample
I uploaded an updated version
I was not clear I guess
What i try to do is to retrieve the list of items displayed in the 2nd listbox to save it to database.
I display in the console the list as a test but what is displayed is the list i set up, not the one updated in both listboxes
I can use your component to move item from one list to another, i can add items programmatically, but i cannot retrieve the items in the list once edited
protected async Task Display()
{
await ListBoxObj.AddItemsAsync(groupC);
var data = ListBoxObj.GetDataList();
} |
THank you this is exactly what i needed