We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Issues on Binding Twice Data in Combobox in .Net 6.0

I have an sfcombobox with 10 data.When I bind third record on button click then it showing as "twice".Please check below screencast and advise how to resolve this issues.

Note:-

The attached code working fine in .Net 5.0 without showing twice record on binding

https://www.screencast.com/t/OBtRBWNpaiHu


Attachment: WebAPI_41989b01.rar


5 Replies

SP Sureshkumar P Syncfusion Team December 5, 2022 11:33 AM UTC

Hi KINS,

The reported issue is not an issue from the component side. The OnInitializedAsync lifecycle triggers two times when the component is rendering which is the reason the data is duplicated twice in the component. To overcome this issue, need to change the render mode from “ServerPrerendered” to “Server” in the _Host.cshtml

Find the code changed here:

<component type="typeof(App)" render-mode="Server" />


To know more about this behavior, refer to the StackOverflow link solution: https://stackoverflow.com/questions/58075628/why-are-blazor-lifecycle-methods-getting-executed-twice

find the modified sample in the attachment:

Regards,

Sureshkumar P


Attachment: WebAPI_932541bd.zip


KI KINS December 6, 2022 04:09 AM UTC

I am using Blazor Web-Assembly..


How to do in this...



SP Sureshkumar P Syncfusion Team December 6, 2022 11:37 AM UTC

KINS, you have attached the server-side sample to replicate the issue on your initial update. So was modified and attached the server-side sample to resolve the issue from our end. if you have faced the same issue in the WASM application, share your issue replicating sample with us, based on your updated sample will validate and update the exact solution as earlier as possible.



KI KINS December 7, 2022 09:26 AM UTC

check this attached example


Attachment: howtocreateacascadingcomboboxmain_171451be.rar


SP Sureshkumar P Syncfusion Team December 8, 2022 10:53 AM UTC

KINS, you have attached a sample with the target framework as netstandard2.1 so created the sample based on your shared code example with .Net 6.0 but still, the issue is not replicated from our end.

Find the validated sample in the attachment.

Still, if you have faced the same issue, then replicate the reported issue on the attached sample and revert us with a detailed issue replication procedure. these details will help us to provide an exact solution as earlier as possible.


Attachment: DDLWASM_7123b3ec.zip

Loader.
Up arrow icon