So, how do I get the combination where the field is populated properly when loaded AND the selectedTags array is updated whenever a tag is added?
Best regards,
Henrik Johansson
|
<SfMultiSelect TValue="List<string>" Placeholder="t.ex. vegetariskt" Mode="VisualMode.Box"
DataSource="@country" CssClass="col-md-4"
AllowFiltering="true" AllowCustomValue="true" Value="@MultiVal" MaximumSelectionLength="5">
<MultiSelectFieldSettings Value="CountryId" Text="CountryName"></MultiSelectFieldSettings>
<MultiSelectEvents TValue="List<string>" OnChipTag="@OnTagging" />
</SfMultiSelect>
@code {
public List<string> MultiVal { get; set; } = new List<string> { "1" , "3" };
public List<Countries> country = new List<Countries>();
public List<string> selectedTags = new List<string>();
public Data myDataItem = null;
protected override async Task OnInitializedAsync()
{
country = await Countries.GetAllRecords();
}
protected void OnTagging(TaggingEventArgs args)
{
System.Diagnostics.Debug.WriteLine($"OnTagging() -- selectedTags: {string.Join(',', selectedTags)}");
}
} |
Hi, I have a similar problem
But Im using a Custom Data Adaptor
I have changed the sample you attached to use a Custom Data Adaptor (most simple possible)
I've also updated to dotnet 9 and version 29.2.11 of syncfusion
Im using the same multiselect but with the DataManager
Here in the first load you can see the first problem, the component renders as if everythihng is selected
If you delete at least one and click into the MultiSelect, it wil show a List of ALL itens, while it should shows only the deleted one
Ive attached the project sample
Hi Daniel,
Kindly follow the below forum link for further discussion regarding the last query “The selected value was shown in the Multi Select popup list while using the custom data manager” in MultiSelect component.
Forum link: https://www.syncfusion.com/forums/197271/problem-with-initial-values
Regards,
YuvanShankar A