CategoriesMultiSelect.SelectAllAsync do not update bind-Value
Hello,
When I call SfMultiselect.SelectAllAsync(true), all values are well selected but the bind-value remain null.
How can I update bind-value?
Thanks
JF
private async void CategoriesMultiSelectDataBound(DataBoundEventArgs args)
{
await CategoriesMultiSelect.SelectAllAsync(true);
}
<SfMultiSelect TValue="string[]" TItem="GetCategoriesResponse" @bind-Value="@Categories"
AllowFiltering=true ShowClearButton="true" ShowSelectAll="true"
Mode="VisualMode.CheckBox" EnableGroupCheckBox=true Placeholder=@_localizer["Categories"]>
<SfDataManager Url="/odata/categories/" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
<MultiSelectFieldSettings GroupBy="CategoryName" Text="Code" Value="Id"></MultiSelectFieldSettings>
</SfMultiSelect>
Hi Jean-François Hermans,
Thank you for reaching out to us with your query regarding the behavior of SfMultiselect's SelectAllAsync(true) method. We understand your concern about the @bind-Value not being updated as expected.
After thoroughly reviewing your code snippet and examining your scenario, we have prepared a sample that meets your requirements. In our test, we were able to successfully update the @bind-Value when using the SelectAllAsync method. You can view the sample in action in the video illustration linked below:
In the video, we demonstrate calling the SelectAllAsync method within a button click event. As a result, the @bind-Values are updated correctly.
To further assist you and ensure our solution aligns perfectly with your specific needs, we kindly request that you modify the provided sample according to your application requirements. By doing so, we can provide you with a more tailored and prompt solution.
Attachment: BlazorServerProject_40e6c23e.zip
Yes, @bind-Values are updated when SelectAllAsync method is called via a button.
But I try to pre-select all the items without user action.
Calling
SelectAllAsync
from DataBoundEvent select all items but don't update
@bind-Values
Hi Jean-François Hermans,
We have considered the reported issue “"SelectAllAsync” do not update @bind-Value” as a bug from our end and the fix for the issue will be included with our upcoming patch release on October 24th , 2023.
Now you can track the status of the reported issue through the feedback below,
Feedback Link: https://www.syncfusion.com/feedback/47470/-selectallasync-do-not-update-bind-value
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Hi Jean-François Hermans,
We have included the fix for the issue ""SelectAllAsync” do not update @bind-Value" with our package version “23.1.43”. Therefore, we recommend upgrading to our latest version to resolve the current issue.
Release notes:https://blazor.syncfusion.com/documentation/release-notes/23.1.43?type=all#multiselect
Hi,
The fix is OK but I discover that MultiSelectEvents.DataBound is called at each keystroke when AllowFiltering=true (he SfDataManager ODataV4Adaptor).
Where can I call SelectAllAsync so that everything is selected on first display but not when ?
Thanks
JF
Hi Jean-François Hermans,
To address your concern and achieve the desired behavior of selecting all items on the initial page load, we recommend utilizing the "Created" event. In response to your query, we have created a sample that incorporates the "SelectAllAsync" method within the "Created" event.
Please take a moment to review the sample at the following link: https://blazorplayground.syncfusion.com/BNrUMCriyitQqJSn
Should you have any further questions or encounter additional challenges, feel free to reach out to us for further assistance.
Regards,
Kokila Poovendran.
- 6 Replies
- 2 Participants
-
JH Jean-François Hermans
- Sep 28, 2023 12:28 PM UTC
- Nov 21, 2023 02:21 PM UTC