The DataSource is properly binding with the Models property in the ViewModel and correctly displaying the full list of Models in the dropdown.
I added a ValueConverter to the SelectedItem binding on the SfAutoComplete control, using the following code:
autoComplete.SetBinding(SfAutoComplete.SelectedItemProperty, "SelectedTags", BindingMode.TwoWay, new ArbitraryValueConverter());
I set a breakpoint within the converter, and verified that the property is properly binding with SelectedModels in the ViewModel class.
On load, despite the binding working, no items appear selected in the control. Additionally, items in SelectedModels are still in the control's dropdown despite IsSelectedItemsVisibleInDropDown being set to "false".
Once I select an item from the dropdown, SelectedModels on the ViewModel is properly updated with the newly selected Model(s), and the selected Model(s) are removed from the dropdown. However, any Models that I attempted to pre-set at instantiation in the SelectedModels property on the ViewModel are gone.
JDJonas DawsonMarch 26, 2019 10:27 AM
I figured it out!!!
On navigation, I was setting the SelectedModels property on the ViewModel, but the Models were not being populated until after ViewModel construction via a web service call. What is clear now is that, at the time of initial appearance, it's important for both the DataSource and the SelectedItem collections to be populated.
I hope this helps someone!
MSMugundhan Saravanan Syncfusion Team March 28, 2019 08:10 AM
Hi Jonas Dawson,
Thanks for the Update.
We are glad to know that the issue is resolved from our side. Please get back to us if you have any further assistance on this.