Cant read Text property of SfAutocomplete controls

Good afternoon!

I've migrated my app from Xamarin to MAUI, and I'm having issues reading the Text property of sfAutocomplete controls. I've prepared a brief demo you can check in this public repo:  waguilar/sfAutocompleteDemo (github.com)

As you can see, I can interact with the SocialMedia property, and it's being updated when I select one option from the AutoComplete control. But the SelectedMediaText is always empty, and the ViewModel doesn't seem to trigger any getter or setter. This is important because, in our app, the user can select an option from a list or enter any value in the text field.

Let me know if you need more info to address this issue.


Cheers!

Walter


1 Reply

BV Brundha Velusamy Syncfusion Team April 5, 2024 12:42 PM UTC

Hi Walter,


We have reviewed your query and the provided sample. Upon further investigation, we identified that the Text property was not set for two-way binding mode, leading to the reported issue. To resolve this issue, we recommend setting the Text property's mode as TwoWay. By utilizing this approach, we can retrieve the SfAutoComplete's text. We have created a sample based on this and attached it for your reference. Please review the attached sample and let us know if you have any concerns.


Please refer the below code snippet for this,

<editors:SfAutocomplete WidthRequest="250"

                        DisplayMemberPath = "Name"

                        TextMemberPath = "Name"

                        Text="{Binding SelectedMediaText, Mode=TwoWay}"

                        SelectedItem="{Binding SocialMedia}"

                        ItemsSource="{Binding SocialMedias}" />


Regards,

Brundha V


Attachment: sfAutocompleteDemo_4fb01fc3.zip

Loader.
Up arrow icon