Hello,
I have a problem in my application.
In my page I have a SfListView with a DataTemplateSelector to show the items in an ObservableCollection. Every template is a ContentView with a Grid and several items. In one of the templates I need to use a SfComboBox, but I doesn't show up anything.
The listview:
<listView:SfListView x:Name="listView" Margin="0,5,0,0" AllowSwiping="True" AutoFitMode="Height" HorizontalOptions="FillAndExpand" ItemSpacing="0" ItemTemplate="{StaticResource DomandeTemplateSelector}" ItemsSource="{Binding ListaDomande}" VerticalOptions="FillAndExpand">
</listView:SfListView>
The template:
<ContentView x:Class="AuditManager.Views.Domanda6ViewCell" http://xamarin.com/schemas/2014/forms" x="http://schemas.microsoft.com/winfx/2009/xaml" combobox="clr-namespace:Syncfusion.XForms.ComboBox;assembly=Syncfusion.SfComboBox.XForms">
<Grid Margin="0" Padding="0" ColumnSpacing="0" HorizontalOptions="FillAndExpand" RowSpacing="0" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="3" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="3" />
</Grid.RowDefinitions>
<BoxView BackgroundColor="{Binding ColoreRisposta, Converter={StaticResource StringToColor}}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
<StackLayout Grid.Row="1" Margin="25,10,0,10" Orientation="Horizontal">
<Label Margin="0" FontSize="14" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Start" Text="{Binding Testo}" TextColor="{StaticResource DarkTextColor}" VerticalOptions="CenterAndExpand" />
</StackLayout>
<StackLayout Grid.Row="2" Margin="25,5" BackgroundColor="{StaticResource AppBackgroundColor}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<StackLayout Padding="30" HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand">
<combobox:SfComboBox x:Name="comboBox" HeightRequest="40" TextColor="Black" />
</StackLayout>
<Entry Placeholder="{Binding PlaceholderNoteToView}" Style="{StaticResource EntryStyle}" Text="{Binding NoteToView}"></Entry>
</StackLayout>
</Grid>
</ContentView>
The code-behind of the template:
public partial class Domanda6ViewCell : ContentView
{
public Domanda6ViewCell()
{
InitializeComponent();
List<string> countryNames = new List<string>
{
"Great Britain",
"Uganda",
"Ukraine",
"Canada",
"France",
"Italy",
"United Kingdom",
"China",
"Japan"
};
comboBox.ComboBoxSource = countryNames;
}
}
SfComboBox version is 16.4.0.53, Xamarin Forms is 3.5, OS is Android (I haven't tested it on other OS yet).
What am I missing?
Thanks in advance,
Matteo