- Home
- Forum
- Xamarin.Forms
- SelectionChanged not fired on clear
SelectionChanged not fired on clear
- SelectionChanged is fired
- But SelectedItem is set to empty string. So if I have SelectedItem={Binding SomeObject}, the app fails to set "SomeObject" since it's not a string. The expected value of SelectedItem is null.
|
public class EmptyStringToNullConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value != null && (string.IsNullOrWhiteSpace(value.ToString()) || value.ToString().Equals("0.0"))) { return null; } else { return value; } } } |
Glad that the issue has been resolved. Please get back to us if any further assistance on this.
Regards,
Selva Kumar V.
Hi Dan Dumitrascu,
Glad that the issue has been resolved. Please get back to us if any further assistance on this.
Regards,
Selva Kumar V.
Hi,
I am having the same trouble with the SfComboBox.
In the iOS app, the problem is that the clear button is not triggering the SelectionChanged event.
Situation: if I get a value on SelectedItem from the view model (and not from the drop down list, for example on an edit view with forms already with values), when I tap the clear button the event is not triggered.
Also in an edit view, where the forms is already filled, the SelectionChanged should be triggered when the view gets SelectedItem property from the view model. This only happens on Android.
In the Android app, the SelectionChanged event works perfectly, but when I change the value of any other SfComboBox IsEnabled to false, and then I call again the SelectionChanged and set this IsEnabled to true, on Android the SfComboBox never becomes enabled again, on iOS it does.
Is it there any solution please? I just updated the latest version of Syncfusion 18.1.0.43.
Thanks for your attention!
Best regards,
Alexandre Vaz.
Greetings from Syncfusion.
We have prepared a sample based on your requirement but unfortunately, we are unable to reproduce the reported issue from our side. Please find the sample from below link,
Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBox_Index_21411608569
Since we are not aware of your exact scenario, so we request you to try our sample, if the issue still persists, could you please revert us by modifying the provided sample with replication steps or provide sample or video. This will be helpful for us to investigate further and provide better solution at the earliest.
Regards,
Sakthivel P.
- 7 Replies
- 5 Participants
-
DD Dan Dumitrascu
- Jan 31, 2019 01:33 PM UTC
- Apr 13, 2020 12:55 PM UTC