Multiselect default value is not working inside another component

I have a Test component that uses SfMultiSelect directly and it works fine


Yet I want to have a wrapper component around SfMultiSelect, and from Test component I am passing the neccessary props.


All the values are correctly received inside the component, and when I debug SfMultiselect @ref, it shows the Values correctly in the object, however, the input doesn't show selected values, even if I call state has changed method. It doesn't change even if I add the values again inside OnAfterRender or OnParametersSet. Same goes if I change value parameter for bind-value.


Wrapper in itself is nothing smart for now:

@typeparam TItem

@typeparam TValue


Value="DefaultValues"

DataSource="@Data"


TValue="IList"

TItem="TItem"

Placeholder="@Placeholder">

TItem="TItem"

TValue="IList"

OnValueSelect="@SelectItem"

OnValueRemove="@RemoveItem"

Cleared="@ClearItems"

>


@code{

[Parameter, EditorRequired]

public string OptionDisplay { get; set; } = default!;


[Parameter, EditorRequired]

public string OptionValue { get; set; } = default!;


[Parameter, EditorRequired]

public IList Data { get; set; } = default!;


[Parameter]

public IList DefaultValues { get; set; } = default!;


[Parameter]

public string Placeholder { get; set; } = "";


private SfMultiSelect, TItem> mulObj;

}


2 Replies

MM Mohanraj Mathaiyan Syncfusion Team July 25, 2022 06:10 PM UTC

Hi Amar,

We are the requirement. We will update the details in two business days (27nd July 2022).


Regards,

Mohanraj M



UD UdhayaKumar Duraisamy Syncfusion Team July 27, 2022 04:25 PM UTC

Hi Amar,


Sorry for the inconvenience caused.


We have validated the reported query on our end and we suspect that you are using the Syncfusion Multiselect component as a custom component. We have attached a simple runnable working custom component sample for your reference. We request you to provide additional details about the query as mentioned below. This will help us validate the issue further and provide you with a better solution.


  1. Are you facing the issue in any particular scenario?
  2. Is the Multiselect component rendered within any other component(Ex: Grid) or alone?
  3. Simple issue reproducing Runnable sample (or modify the previously attached sample).
  4. If possible please attach a Video illustration of the issue.


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/DDLcustomComponent1223381490


Regards,

Udhaya Kumar D



Loader.
Up arrow icon