Hello,
I have a DropDownList control with UrlAdaptor:
<div class="gp-inline-form-elements">
<SfDropDownList @ref="cbSzallitok" @bind-Value="@AddOrEditDto.Szallito" TValue="OptionDto<int>" TItem="OptionDto<int>" TabIndex="3" Placeholder="Szállító" AllowFiltering="true" FloatLabelType="FloatLabelType.Always" Query="cbSzallitokQuery">
<SfDataManager @ref="dmSzallitok" Url="api/szallito/options" CrossDomain="true" Adaptor="Adaptors.UrlAdaptor" Offline=true></SfDataManager>
<DropDownListFieldSettings Text="Text" />
</SfDropDownList>
<SfButton Type="button" CssClass="btn-form" IconCss="e-icons e-refresh" OnClick="@(async () => { cbSzallitokQuery = new Query(); await ShowToastOkAsync("Ez egy fontos információ"); })"></SfButton>
</div>
I would like refresh the dropdown datasource every time when the user clicks on the Refresh button,
The above code works only at first time, second time nothing happen.
I try with WhereFilter too, but this works also only at first time.
I try with below lines too, but nothing changed, only works at first time:
// cbSzallitok.Query = new Query().Where(new WhereFilter() { Field = "Id", Operator = "equal", value = args.ValueDto.Id, IgnoreCase = false, IgnoreAccent = false });
// cbSzallitokQuery = null;
// cbSzallitokQuery = new Query().Where(new WhereFilter() { Field = "Id", Operator = "equal", value = args.ValueDto.Id, IgnoreCase = false, IgnoreAccent = false });
There are another method to refresh the datasource or why the above code not working any time?
Thanks for help!
BR, SZL
Hi SZL,
We are validating the requirement. We will update the further details in two business days (22nd April 2022).
Regards,
Udhaya Kumar D
Hi SZL,
We couldn’t reproduce the reported issue as per your scenario. We have attached a working sample for your reference, Also we request you to provide additional details about the issue i.e. replication procedure, issue replication sample, etc... Which will help us to validate the issue further and provide you with a better solution.
Regards,
Udhaya Kumar D
Hi,
Thank you for the sample.
I find the reason: I have an Offine="true" parameter in SfDataManager.
When I remove this, the datasource refreshing successfully.
My problem is that I cannot remove it, because with this Offline parameter I can prevent the server-side filtering in the dropdown. I would like use client-side filtering without server interaction and I can do this with the Offline="true" parameter.
Can you suggest me a solution for do the following jobs together:
- use client side filtering in combobox (dropdownlist)
- working refresh button not only at first time.
Thank you very much!
Hi SZL,
We have considered the reported requirement “Need to provide offline mode support for dropdown components” as feature at our end and this support will be included in any one of our upcoming releases. At the planning stage for every release cycle, we review all open features, and this will be included in any of our upcoming future releases. You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link:
Feedback Link: https://www.syncfusion.com/feedback/34188/need-to-provide-offline-mode-support-for-dropdown-components
Please cast your vote to make it count. We will prioritize the features every release based on the demands. If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.
Also, We have prepared a sample for changing the datasource dynamically and attached it below for reference.
Regards,
Udhaya Kumar D
Hello,
Thank you for the sampe, but it is not too relevant for me, because I use DataManager and UrlAdaptor to set the datasource. The first post contains my DataManager code.
I think the best solution would be to create a Refresh() (RefreshAsync()) method in all controls that can use DataManager. In SfGrid this Refresh() method works perfect to update the datasource, but unfortunatelly this method missing from other controls (like DropDownList for example).
So, if I good understand, there are no solution yet to use client side filtering in dropdownlist and refresh the datasource (with DataManager) together?
Thank you!
BR, László
Hi SZL,
We have already working on the reported issue on our end. The fix will be included in the Volume 1 SP1 release. The Volume 1 SP1 will be released in the second week of May 2022.
You can track the status using the below feedback link.
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.”
Regards,
Udhaya Kumar D
Hi SZL,
We have implemented the “Need to refresh the datasource dynamically using remote data” feature in the latest 20.1.52 version. Now, You can refresh the popup items using the RefreshDataAsync method. So, we suggest you upgrade to our latest version to use this feature.
Please find the release notes here:
https://blazor.syncfusion.com/documentation/release-notes/20.1.52?type=all#features-1
Regards,
Udhaya Kumar D
Hello,
Thank you very much for the fast development! I tested it, the RefreshDataAsync works well, but I will test it deeper later.
EDIT: I test the RefreshDataAsync method when the SfDataManager Offline property is set to "true" but in this case the DropDown content not refreshing. That was the main problem, that I cannot use client side filtering (Offline="true") and the combo refresh together.
I think the possible solution can be to add an optional parameter to RefresDataAsync(), for example:
RefreshDataAsync(bool force = false)
and if it called with force = true, the datasource will be refreshing even if the Offline parameter is set to true.
Unfortunatelly the DropDownList filter has an anomaly during typing in the filter textbox with this new version.
First time works well. But after I select an item and try filter the list again, the second time the combo is not filtered.
I attach a video to show this behavior.
My dropdown code:
<div class="gp-inline-form-elements">
<SfDropDownList @ref="cbSzallitok" TValue="OptionDto<int>" TItem="OptionDto<int>" TabIndex="3" Placeholder="Szállító" AllowFiltering="true" FloatLabelType="FloatLabelType.Always"
@bind-Value="@AddOrEditDto.Szallito">
<SfDataManager @ref="dmSzallitok" Url="api/szallito/options" CrossDomain="true" Adaptor="Adaptors.UrlAdaptor" Offline="true"></SfDataManager>
<DropDownListFieldSettings Text="Text" />
</SfDropDownList>
<SfButton Type="button" CssClass="btn-form" IconCss="e-icons e-plus" OnClick="@(async (e) => { SubDialogType = eSubDialog.Szallitok; IsSubDialogVisible_Szallitok = true; })"></SfButton>
<SfButton Type="button" CssClass="btn-form" IconCss="e-icons e-refresh" OnClick="@(async () => { await cbSzallitok.RefreshDataAsync();})"></SfButton>
</div>
Thank you for help!
BR, SZL
Attachment: dropdownfilter_d18ded3.zip