The SFComboBox in UWP not displaying the data correctly

In IOS & Android the list is displayed correctly, but not in UWP

The Code:

XAML:

                            <inputLayout:SfTextInputLayout x:Name="comboBoxSectionFrame" Hint="Track Surface" HelperText="Select Track Surface"
                     ContainerType="Outlined"
                     OutlineCornerRadius="8"
                     FocusedColor="#00AFA0"
                     UnfocusedColor="Silver"
                     Margin="10,0,10,0" IsVisible="False">
                                <combobox:SfComboBox  SelectedItem="Asphalt" x:Name="comboBoxSectionProfil" IsEditableMode="True" />
                            </inputLayout:SfTextInputLayout>

C#:

       ObservableCollection<TrackSurface> trackSurface = new ObservableCollection<TrackSurface>();

        public class TrackSurface
        {
            public string SurfaceName { get; set; }
        }


            trackSurface.Add(new TrackSurface { SurfaceName = "ROAD" });
            trackSurface.Add(new TrackSurface { SurfaceName = "SKY" });
            trackSurface.Add(new TrackSurface { SurfaceName = "WATER" });
            trackSurface.Add(new TrackSurface { SurfaceName = "GRAVEL" });

            comboBoxSectionProfil.DataSource = trackSurface;

In UWP it looks like:


For example in IOS (Android same):


Thanks,

Markus

4 Replies

MA Markus May 10, 2020 10:15 AM UTC

I figured it out, I will make it this way:

   List<String> surfaceName = new List<String>();
            surfaceName.Add("ROAD");
            surfaceName.Add("WATER");
            surfaceName.Add("GARVEL");
            surfaceName.Add("FORSTROAD");

            comboBoxSectionProfil.ComboBoxSource = surfaceName;


RS Ramya Soundar Rajan Syncfusion Team May 11, 2020 01:46 PM UTC

Hi Markus, 
 
Greetings from Syncfusion. 
 
We have checked your reported query and we would like to suggest you set DisplayMemberPath property when providing the data with model class as like in below code snippet to resolve the problem. 
 
comboBoxSectionProfil.DisplayMemberPath = "SurfaceName"; 
 
 
 
Output: 
 
 
Please let us know, if you need any further assistance on this. 
 
Regards, 
Ramya S 



MA Markus May 12, 2020 01:29 PM UTC

Hallo Ramya,

thank you, I test the Setting and it would also solve my problem

Thanks,

Markus


SP Sakthivel Palaniyappan Syncfusion Team May 13, 2020 05:44 AM UTC

Hi Markus,

Thanks for the update.

Please let us know if you need further assistance on this.

Regards,
Sakthivel P. 


Loader.
Up arrow icon