Using non ComboBoxItem in ComboBox
Hi,
I'm trying to use a control other than a ComboBoxItem in a ComboBox control.
It appears in the drop down list fine.
Problem is it does not appear when selected.
Works fine in WPF (anything seems to work in fact, TextBlock, etc. but not in Noesis).
Is this a limitation or possibly something I might be doing wrong?
I could post some sample XAML if needed, but wanted to see if it was something known first.
I'm trying to use a control other than a ComboBoxItem in a ComboBox control.
It appears in the drop down list fine.
Problem is it does not appear when selected.
Works fine in WPF (anything seems to work in fact, TextBlock, etc. but not in Noesis).
Is this a limitation or possibly something I might be doing wrong?
I could post some sample XAML if needed, but wanted to see if it was something known first.
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: Using non ComboBoxItem in ComboBox
There is a known issue about that: #1125.
The problem can be avoided by using data binding and a data template for the item.
Can that work for you?
The problem can be avoided by using data binding and a data template for the item.
Code: Select all
<Grid>
<Grid.Resources>
<DataTemplate x:Key="itemTemplate">
<StackPanel Orientation="Horizontal">
<Rectangle Width="20" Fill="{Binding Fill}"/>
<Button Content="..." Margin="5,0" Padding="5,0"/>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</Grid.Resources>
<ComboBox ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}"/>
</Grid>
Re: Using non ComboBoxItem in ComboBox
Ah, that's a shame. Thanks for posting an alternative, I'll have a play with that and get back to you.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests