-
-
Notifications
You must be signed in to change notification settings - Fork 863
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Setting a group style in ComboBox dont seem to work in wpfui. Works in traditional wpf.
Itemspresenter does not show any items.
Tried other ItemsControl variants, like ListView and they work.
Also seems to be a problem with setting a custom ItemsPanel, maybe related.
To Reproduce
In this example MySourceView is a CollectionViewSource with a GroupDescription added
<ComboBox
ItemsSource="{Binding MySourceView}"
SelectedValue="{Binding Path=MySelectedValue}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander>
<Expander.Header>
<TextBlock Text="{Binding Path=Name}"/>
</Expander.Header>
<Expander.Content>
**<ItemsPresenter/>**
</Expander.Content>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ComboBox.GroupStyle>
</ComboBox>
Expected behavior
Items should appear in their respective Expander
Screenshots
OS version
Win 11
.NET version
Net 8
WPF-UI NuGet version
3.0.4
Additional context
Had a look at the control template and it has a Stackpanel with IsItemsHost="True", not an ItemsPresenter.
RichardD2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working