ComboBox suggestion box does not refresh when itemsource changes

Hi,

I'm migrating from Xamarin forms to MAUI and . The combobox control does not have a clear method unlike the Xamarin version. When i change the itemsource of the combobox, the old items stays as is in the dropdown list and the new items are added. I have tried various options to clear the suggestion box but nothing helps.

  1. setting itemssource=null - does not work;
  2. I use List<T> as itemmsource withINotifyPropertyChange implemented - does not work;
  3. changing List<T> to  ObservableCollection<T> does not work.


For example: I have a combobox to show multiple hospital addresses where a doctor works. When i select the first doctor, the addresses are displayed in the combobox properly. Without moving away from the page, if i select another doctor, the address combobox shows the new doctor addresses along with the old doctor address. When the old doctor address is selected, selected value property is set to null. This is causing a lot of confusion to the user.

Sample Code (MAUI):

                    cbomaaddress.ItemsSource= null;

                    cbomaaddress.SelectedIndex = -1;

                    cbomaaddress.DisplayMemberPath = "Key";

                    cbomaaddress.SelectedValuePath = "Value";

addresses = await GetDrAddressesData(DOCTOR_ID);

                    cbomaaddress.ItemsSource = addresses;

                    cbomaaddress.SelectedIndex = 0;


In Xamarin I as simply doing cbomaaddress.Clear() before resetting the itemssource property with 

                    cbomaaddress.Clear();

                    cbomaaddress.DisplayMemberPath = "Key";

                    cbomaaddress.SelectedValuePath = "Value";

addresses = await GetDrAddressesData(DOCTOR_ID);

                    cbomaaddress.ItemsSource = addresses;

                    cbomaaddress.SelectedIndex = 0;


This is quite urgent and critical as it is delaying our migration to MAUI. Let me know how to clear the suggestion list of combobox when the data/item source changes.

Thanks

Santhosh


4 Replies 1 reply marked as answer

HC Hariharan Chokkalingam Syncfusion Team June 20, 2024 11:58 AM UTC

Hi Santhosh Kumar,

 

Thank you for reaching out to us.

 

We have addressed the reported issue "ComboBox suggestion box does not refresh when itemsource changes" on our end. At present, a custom patch has been created for version 26.1.38 We have attached the NuGet files for your convenience.  

 

Please note that we have created this patch for version 26.1.38 specifically to resolve the issue reported in this ticket. If you have received other patches for the same version for other products, please apply all patches in the order received.

 

Please clear the NuGet cache, before using the latest one and please refer to the below link for this

How to clear NuGet cache?

 

Please refer to the below KB to install the custom NuGet on a local machine,

How to install the MAUI custom NuGet in the Windows machine?

 

This fix will be included in our weekly release on July 2, 2024. We will notify you once NuGet is released and appreciate your understanding and patience until that time.

 

Disclaimer: The inclusion of this solution in the weekly release may change due to other factors, including but not limited to QA checks and work reprioritization.

 

Root cause and resolution:

Root Cause: The issue stemmed from an internal error that occurred during LoadMore feature support, Due to which the items added dynamically to the ItemsSource using binding misbehaves.

Resolution: Now we have resolved the logics to fix this issue at our source.

 

Regards,

Hariharan C.


Attachment: Syncfusion.Maui.Inputs.26.1.38_6c9010f9.zip

Marked as answer

SK Santhosh Kumar replied to Hariharan Chokkalingam June 21, 2024 09:56 AM UTC

Dear Hari,


Thank you, the fix worked for me. I suggest, to please bring the Clear method which is more straight forward to the user to clear the combo box.


Thanks


Santhosh



HC Hariharan Chokkalingam Syncfusion Team June 24, 2024 10:41 AM UTC

Hi Santhosh Kumar,

We have reviewed your query and currently, we don’t have support for Clear Method in SfComboBox, so we created a feature request to "Provide Clear method support for the SfComboBox and SfAutocomplete in .NET MAUI". Please find the link below to track the status of the feature implementation.


Feedback link: 58927      


Please cast your vote to make it count. We will prioritize the features every release based on the demands, and we do not have an immediate plan to implement this feature since we have committed to already planned work. So, this feature will be available in any of our upcoming releases.


If you have any more specifications/suggestions for the feature request, you can add them as a comment in the portal. We will share the release details in the feedback itself.


Regards,

Hariharan C.



HC Hariharan Chokkalingam Syncfusion Team July 2, 2024 07:11 AM UTC

Hi Santhosh Kumar,

 

We have included the fix for the reported issue "ComboBox suggestion box does not refresh when itemsource changes" in our weekly NuGet release v26.1.39 which is available for download (NuGet). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.

 

Regards,

Hariharan C.


Loader.
Up arrow icon