Hello, I am trying to populate sfComboBox with objects USING A CONVERTER. I am able to populate the data. when i open the combobox, it show correct values. but when i select a value from the combobox it shows the path of the object.
I set the ItemsSource programmatically.
<combobox:SfComboBox x:Name="combo1"
SelectedIndex="{Binding }"
MultiSelectMode="None"
DisplayMemberPath="{Binding DateAndTime, Converter={StaticResource RelativeTimeConverter}}">
<combobox:SfComboBox.ItemTemplate>
<DataTemplate>
<Grid >
<StackLayout Orientation="Horizontal">
<Label Text="{Binding DateAndTime, Converter={StaticResource RelativeTimeConverter}}"
FontSize="Medium" HorizontalOptions="Center" VerticalOptions="Center"/>
</StackLayout>
</Grid>
</DataTemplate>
</combobox:SfComboBox.ItemTemplate>
</combobox:SfComboBox>
public class DateTimeObject
{
public DateTime DateAndTime { get; set; }
public int Id { get; set; }
public DateTimeObject(int id, DateTime dt)
{
id = Id;
DateAndTime = dt;
}
}
I the the problem is to set DisplayMemberPath correctly. could you please help. Best regards.