All items not selected when using KeyValuePair generic class

I have the following SfMultiSelect with its DataSource set to a List<KeyValuePair<int, string>>.

                                        
<SfMultiSelect TValue="int[]"
                TItem="KeyValuePair<int, string>"
                Mode="@VisualMode.Box"
                AllowFiltering="true"
                ShowSelectAll="true"
                ShowDropDownIcon="true"
                EnableSelectionOrder="true"
                EnableCloseOnSelect="false"
                Placeholder="@localizer[Resources.App.DaysOfWeek]"
                FloatLabelType="FloatLabelType.Always"
                DataSource="@daysOfWeek"
                @bind-Value="@recurringJob.SelectedDaysOfWeek"
                Enabled="@(!recurringJob.EveryDayOfWeek)">
                <MultiSelectFieldSettings Text="@nameof(KeyValuePair<int, string>.Value)"
                                          Value="@nameof(KeyValuePair<int, string>.Key)">
                </MultiSelectFieldSettings>
</SfMultiSelect>

@code {

     private List<KeyValuePair<int, string>> daysOfWeek = new();

}

recurringJob.SelecteDaysOfWeek is defined as:

[NotMapped]
public int[] SelectedDaysOfWeek
{
    get => string.IsNullOrWhiteSpace(this.CronDaysOfWeek)
        ? new int[0]
        : this.CronDaysOfWeek.Split(',').Select(x => Convert.ToInt32(x)).ToArray();
    set => this.CronDaysOfWeek = string.Join(",", value);
}


Everything works fine initially and I'm able to select multiple items.  


But when I open the record back up only the first item that was selected is still selected.


I've confirmed through debugging in the BeginEdit Action RequestType that the recurringJob.SelectedDaysOfWeek array contains all three values.

I think it has something to do with using the KeyValuePair generic class.  If I create a simple class with an int and string property it works fine.  

Also, note the positioning of the label.  As I select more items and the list gets taller, the label moves down.

Thanks,

Craig


3 Replies

VJ Vinitha Jeyakumar Syncfusion Team January 18, 2022 01:31 PM UTC

Hi Craig,


Currently, we are validating on your reported query. we will update you the further details in two business days on or before 20th January 2022.


Regards,

Vinitha



PM Ponmani Murugaiyan Syncfusion Team January 21, 2022 10:11 AM UTC

Hi Craig, 

We have considered the reported issue as bug “MultiSelect with Box mode with FloatLabelType.Always placeholder display issue” in our end. The fix will be included in the upcoming patch release, which is expected to be rolled out on February 02, 2022. You can track using the below feedback link. 


Regards, 
Ponmani M 



SP Sureshkumar P Syncfusion Team February 4, 2022 03:34 AM UTC

Hi Craig, 
 
 
We are glad to announce that fix for the issue " Multiselect component placeholder moves along with the input when increases with row height" has been rolled out in our Essential Studio 2021 Volume 4 Service Pack. We request you to upgrade the package to “19.4.48” version to get rid of this issue. 
 
 
 
 
Regards, 
 
Sureshkumar P 


Loader.
Up arrow icon