Combobox show incorrect Text o after a few selections and deselections

Hi there, i have an issue with sfcombobox. 
When a value is selected and deselected a few times the combobox start to shows a wrong Text or DisplayMemberPath. First it shows a Text diferent from the SelectedItem and after a couple trys it modifies another combobox showed Text.
In this particular case the selected value in DeliveryDepartmentPicker changes the FiscalDepartmentPicker Text, but the selected value is always correct . Its like if the Text doesnt change correctly with the SelectedItem.

(The property Text wasnt needed at first, we were using DisplayMemberPath only, but it was implemented because the fields doesnt actualize properly after clearing everithing from viewmodel)
In the attached file is visible how a value is selected and ahother is showed
Thanks for your help
<!--#region Location Section-->
<Label
Text="Direcciones"
Style="{StaticResource TitleLabelStyle}"/>
<border:SfBorder
Style="{StaticResource EntryBorderStyle}">
<!--Fiscal-->
<border:SfBorder
Grid.Row="1"
IsEnabled="{Binding unmodifiableFields, Converter={StaticResource InverseBoolConverter}}"
Padding="5"
BackgroundColor="{DynamicResource Gray-100}"
BorderColor="LightGray"
ShadowColor="LightGray"
HasShadow="True"
CornerRadius="4">
<StackLayout>
<!--Label Principal-->
<Label
Text="Domicilio Fiscal"
Style="{StaticResource SubtitleLabelStyle}" />
<!--Combo departamento-->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<combobox:SfComboBox
x:Name="FiscalDepartmentPicker"
Margin="8,8,0,0"
DataSource="{Binding departmentsList}"
SelectedItem="{Binding selectedFiscalDepartment}"
Text="{Binding selectedFiscalDepartment.Name, Converter={StaticResource IsComboNullConverter}}"
DisplayMemberPath ="Name"
Style="{StaticResource TextInputLayoutComboBoxStyle}"
VerticalOptions="CenterAndExpand"
Watermark="Partido">
<combobox:SfComboBox.Behaviors>
<local1:EventToCommandBehavior Command="{Binding FiscalDepartmentChangedCommand}" EventName="SelectionChanged"/>
</combobox:SfComboBox.Behaviors>
</combobox:SfComboBox>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[FiscalDepartmentId].message, Mode=TwoWay}"
IsVisible="{Binding ErrorMessages[FiscalDepartmentId].visible}"/>
<!--Ciudad Combo ciudades-->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<combobox:SfComboBox
x:Name="FiscalCityPicker"
IsEnabled="{Binding enabledFiscalCitiesCombo}"
DataSource="{Binding fiscalCitiesList}"
SelectedItem="{Binding selectedFiscalCity, Mode=TwoWay}"
Text="{Binding selectedFiscalCity.Name, Converter={StaticResource IsComboNullConverter}}"
DisplayMemberPath="Name"
Style="{StaticResource TextInputLayoutComboBoxStyle}"
VerticalOptions="CenterAndExpand"
Watermark="Localidad">
<combobox:SfComboBox.Behaviors>
<local1:EventToCommandBehavior Command="{Binding FiscalCitySelectedCommand}" EventName="SelectionChanged"/>
</combobox:SfComboBox.Behaviors>
</combobox:SfComboBox>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[FiscalCityId].message, Mode=TwoWay}"
IsVisible="{Binding ErrorMessages[FiscalCityId].visible}"/>
<!--Codigo Postal y barrio-->
<Grid ColumnDefinitions="0.5*,0.5*">
<StackLayout Grid.Column="0" VerticalOptions="StartAndExpand">
<border:SfBorder
BorderColor="{Binding Source={x:Reference FiscalPostalCodeEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="FiscalPostalCodeEntry"
Keyboard="Text"
Placeholder="Cod. Postal"
MaxLength="8"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding resellerFiscalPostalCode}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[FiscalPostalCode].message}"
IsVisible="{Binding ErrorMessages[FiscalPostalCode].visible}"/>
</StackLayout>
<StackLayout Grid.Column="1" VerticalOptions="StartAndExpand">
<border:SfBorder
BorderColor="{Binding Source={x:Reference fiscalneighbornhoodEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="fiscalneighbornhoodEntry"
Placeholder="Barrio"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.FiscalNeighborhood}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text=" "
IsVisible="{Binding ErrorMessages[FiscalPostalCode].visible}"/>
</StackLayout>
</Grid>
<!--Autocompletar de calles-->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<autocomplete:SfAutoComplete
x:Name="autoComplete"
IsEnabled="{Binding streetFiscalAutocompleteEnabled}"
DataSource="{Binding fiscalStreetsList}"
DisplayMemberPath="Name"
Watermark="Calle"
LoadMoreText="Ver mas"
MaximumSuggestion="3"
Text="{Binding searchTextFiscalStreet}"
Style="{StaticResource TextInputLayoutAutocompleteStyle}"
SelectedItem="{Binding selectedFiscalStreet, Mode=TwoWay}">
<autocomplete:SfAutoComplete.Behaviors>
<local1:EventToCommandBehavior Command="{Binding FocusChangedCommand}" EventName="FocusChanged"/>
</autocomplete:SfAutoComplete.Behaviors>
</autocomplete:SfAutoComplete>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[FiscalStreetId].message}"
IsVisible="{Binding ErrorMessages[FiscalStreetId].visible}"/>
<!--Alt Depto Piso-->
<Grid ColumnDefinitions="0.5*,0.5*">
<StackLayout Grid.Column="0" VerticalOptions="StartAndExpand">
<border:SfBorder
BorderColor="{Binding Source={x:Reference fiscalStreetEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="fiscalStreetEntry"
Keyboard="Telephone"
Placeholder="Altura Nro."
IsPassword="False"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding resellerFiscalStreetNumber}"
TextChanged="Integer_TextChanged">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[FiscalStreetNumber].message}"
IsVisible="{Binding ErrorMessages[FiscalStreetNumber].visible}"/>
<border:SfBorder
BorderColor="{Binding Source={x:Reference fiscalfloorEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="fiscalfloorEntry"
Keyboard="Telephone"
Placeholder="Piso"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.FiscalFloor}"
TextChanged="Integer_TextChanged">
</controls:BorderlessEntry>
</border:SfBorder>
</StackLayout>
<StackLayout Grid.Column="1" VerticalOptions="StartAndExpand">
<border:SfBorder
BorderColor="{Binding Source={x:Reference fiscaldepartmentEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="fiscaldepartmentEntry"
Keyboard="Text"
Placeholder="Dpto. Nro."
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.FiscalApartment}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text=" "
IsVisible="{Binding ErrorMessages[FiscalStreetNumber].visible}"/>
</StackLayout>
</Grid>
</StackLayout>
</border:SfBorder>
<!--Entrega-->
<border:SfBorder
Grid.Row="2"
IsVisible="{Binding AddressEquals,Converter={StaticResource InverseBoolConverter}}"
x:Name="deliveryAddressSection"
Padding="5"
BackgroundColor="{DynamicResource Gray-100}"
BorderColor="LightGray"
ShadowColor="LightGray"
HasShadow="True"
CornerRadius="4">
<StackLayout>
<!--Label principal-->
<Label
Text="Domicilio de Entrega"
Style="{StaticResource SubtitleLabelStyle}" />
<!--Departamento-->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<combobox:SfComboBox
x:Name="DeliveryDepartmentPicker"
DataSource="{Binding departmentsList}"
SelectedItem="{Binding selectedDeliveryDepartment}"
DisplayMemberPath ="Name"
Text="{Binding selectedDeliveryDepartment.Name, Converter={StaticResource IsComboNullConverter}}"
Style="{StaticResource TextInputLayoutComboBoxStyle}"
VerticalOptions="CenterAndExpand"
Watermark="Partido">
<combobox:SfComboBox.Behaviors>
<local1:EventToCommandBehavior Command="{Binding DeliveryDepartmentChangedCommand}" EventName="SelectionChanged"/>
</combobox:SfComboBox.Behaviors>
</combobox:SfComboBox>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[DeliveryDepartmentId].message, Mode=TwoWay}"
IsVisible="{Binding ErrorMessages[DeliveryDepartmentId].visible}"/>
<!--Ciudad-->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<combobox:SfComboBox
x:Name="DeliveryCityPicker"
IsVisible="{Binding enabledDeliveryCitiesCombo}"
DataSource="{Binding deliveryCitiesList}"
SelectedItem="{Binding selectedDeliveryCity}"
DisplayMemberPath ="Name"
Text="{Binding selectedDeliveryCity.Name, Converter={StaticResource IsComboNullConverter}}"
Style="{StaticResource TextInputLayoutComboBoxStyle}"
VerticalOptions="CenterAndExpand"
Watermark="Localidad">
<combobox:SfComboBox.Behaviors>
<local1:EventToCommandBehavior Command="{Binding DeliveryCitySelectedCommand}" EventName="SelectionChanged"/>
</combobox:SfComboBox.Behaviors>
</combobox:SfComboBox>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[DeliveryCityId].message, Mode=TwoWay}"
IsVisible="{Binding ErrorMessages[DeliveryCityId].visible}"/>
<Grid ColumnDefinitions="0.5*,0.5*">
<StackLayout Grid.Column="0" VerticalOptions="StartAndExpand">
<!--Cod Postal-->
<border:SfBorder
BorderColor="{Binding Source={x:Reference DeliveryPostalCodeEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="DeliveryPostalCodeEntry"
Keyboard="Chat"
MaxLength="8"
Placeholder="Cod. Postal"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding resellerDeliveryPostalCode}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[DeliveryPostalCode].message}"
IsVisible="{Binding ErrorMessages[DeliveryPostalCode].visible}"/>
</StackLayout>
<StackLayout Grid.Column="1" VerticalOptions="StartAndExpand">
<!--Barrio-->
<border:SfBorder
BorderColor="{Binding Source={x:Reference DeliveryNeighbornhoodEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="DeliveryNeighbornhoodEntry"
Placeholder="Barrio"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.DeliveryNeighborhood}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text=" "
IsVisible="{Binding ErrorMessages[DeliveryPostalCode].visible}"/>
</StackLayout>
</Grid>
<!--Autocompletar Calle -->
<inputLayout:SfTextInputLayout
Style="{DynamicResource TextInputLayoutStyle}">
<autocomplete:SfAutoComplete
x:Name="autoCompleteDelivery"
IsEnabled="{Binding streetDeliveryAutocompleteEnabled}"
DataSource="{Binding deliveryStreetsList}"
DisplayMemberPath="Name"
Watermark="Calle"
LoadMoreText="Ver mas"
MaximumSuggestion="3"
SelectedItem="{Binding selectedDeliveryStreet, Mode=TwoWay}"
Text="{Binding searchTextDeliveryStreet}"
Style="{StaticResource TextInputLayoutAutocompleteStyle}" >
<autocomplete:SfAutoComplete.Behaviors>
<local1:EventToCommandBehavior Command="{Binding FocusChangedCommand}" EventName="FocusChanged"/>
</autocomplete:SfAutoComplete.Behaviors>
</autocomplete:SfAutoComplete>
</inputLayout:SfTextInputLayout>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[DeliveryStreetId].message}"
IsVisible="{Binding ErrorMessages[DeliveryStreetId].visible}" />
<Grid ColumnDefinitions="0.5*,0.5*">
<StackLayout Grid.Column="0" VerticalOptions="StartAndExpand">
<!--Altura Nro-->
<border:SfBorder
BorderColor="{Binding Source={x:Reference DeliveryStreetEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="DeliveryStreetEntry"
Keyboard="Telephone"
Placeholder="Altura Nro."
IsPassword="False"
Text="{Binding resellerDeliveryStreetNumber}"
Style="{StaticResource BorderlessEntryStyle}"
TextChanged="Integer_TextChanged">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text="{Binding ErrorMessages[DeliveryStreetNumber].message}"
IsVisible="{Binding ErrorMessages[DeliveryStreetNumber].visible}"/>
<!--Piso-->
<border:SfBorder
BorderColor="{Binding Source={x:Reference DeliveryfloorEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="DeliveryfloorEntry"
Keyboard="Telephone"
Placeholder="Piso"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.DeliveryFloor}"
TextChanged="Integer_TextChanged">
</controls:BorderlessEntry>
</border:SfBorder>
</StackLayout>
<StackLayout Grid.Column="1" VerticalOptions="StartAndExpand">
<!--Depto Nro-->
<border:SfBorder
BorderColor="{Binding Source={x:Reference DeliverydepartmentEntry}, Path=IsFocused, Converter={StaticResource ColorConverter}, ConverterParameter=3}"
Style="{StaticResource DataFormBorderlessEntryBorderStyle}">
<controls:BorderlessEntry
x:Name="DeliverydepartmentEntry"
Keyboard="Chat"
Placeholder="Dpto. Nro."
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding newReseller.DeliveryApartment}">
</controls:BorderlessEntry>
</border:SfBorder>
<Label
Style="{StaticResource ValidationLabelStyle}"
Text=" "
IsVisible="{Binding ErrorMessages[DeliveryStreetNumber].visible}"/>
</StackLayout>
</Grid>
</StackLayout>
</border:SfBorder>
</StackLayout>
</border:SfBorder>
<!--#endregion-->

Attachment: demo_dd20d636.rar

3 Replies

RS Ruba Shanmugam Syncfusion Team September 27, 2022 11:53 AM UTC

Hi Nelson,

Query: Combobox show incorrect Text o after a few selections and deselections


We have prepared the sample based on the provided code snippet using the SfComboBox with the latest version but we don’t know the exact C# code in your application, and we couldn’t able to replicate the reported issue. We have prepared a sample and video for your reference. Please get the sample and video from the attachment.


We ask you to try our sample and if your requirement is different, please explain to us briefly and share the replication steps with the sample and the reported issue platform details. It will help us to provide the proper solution at the easiest.  Please let us know if you need any other details.


Regards,

Ruba Shanmugam


Attachment: ComboBox_177786_Sample_44ec96d6.zip


NE Nelson September 27, 2022 08:26 PM UTC

Hi. I found a solution but im still dont know why it doesnt work in a normal way.
In the image u can see the result var that should be the selected item, but is an object with the correct id and the wrong name (the name is from a previous selection)
So in the last line i search the selecteditem by the Id from the local db .





RS Ruba Shanmugam Syncfusion Team September 28, 2022 10:10 AM UTC

Hi Nelson,


We are pleased to hear that you have resolved the reported issue on your side. Even though, could you please let us know whether you are facing the same issue with the already provided sample? If not, please modify the sample and share the replication procedure.  It will help us to reproduce the issue on our side and provide a better solution earlier. Please let us know if you need any other details.


Regards,

Ruba Shanmugam


Loader.
Up arrow icon