Multiselect doesn't clear binding value

Hello,

I've placed a Multiselect inside a custom component and all values are passed as parameters from the parent component (Datasource and binding Value,  please see my attached example). 

When I try to remove the values (looking at my example, it has the value "1") either by clicking the chip or by pressing the X button on the right it doesn't remove it. If I add a new one, this can be removed

Thanks in advanced,

Bill

Attachment: BlazorApp1_ff6c8a36.rar

3 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team July 2, 2020 01:33 PM UTC

Hi Bill, 


Greetings from Syncfusion support. 


We checked the reported requirement. The cause of the problem is you mapped the int type field(ID) to the value property of the component fields property. But you were updating the List <string> to the component. Therefore, the reported problem arises. So, we suggest that the List < string > be modified to List < int > in all places to resolve the problem. Refer to the code below, 

  public class GeneralForDropDown 
    { 
        public int ID { get; set; } 
        public string CODE { get; set; } 
        public string DESCR { get; set; } 
    } 
 
<SfMultiSelect  TValue="List<int>" Placeholder="My List" DataSource="@myList" 
                           @bind-Value="@Value.Items"  
                           AllowCustomValue="false"> 
                <MultiSelectFieldSettings Text="CODE" Value="ID"></MultiSelectFieldSettings> 
                <MultiSelectEvents TValue="List<int>" ValueChange="OnValueChanged"  ></MultiSelectEvents> 
            </SfMultiSelect> 
 
public class ForMultiselect 
    { 
        public int InternalID { get; set; } 
        public bool Include { get; set; } 
        public List<int> Items { get; set; } 
    } 



Regards, 
Sevvandhi N 


Marked as answer

BL Bill Lemonis July 3, 2020 11:44 AM UTC

Thanks a lot!

Regards,
Bill



SN Sevvandhi Nagulan Syncfusion Team July 3, 2020 12:40 PM UTC

Hi Bill, 


Thanks for the update. Please let us know if you need any other further assistance. 

Regards, 
Sevvandhi N 


Loader.
Up arrow icon