Skip to content

fix(controls): Add ItemsPanel to ComboBox to enable GroupStyle support#1645

Merged
pomianowski merged 1 commit intolepoco:mainfrom
frostybee:main
Jan 13, 2026
Merged

fix(controls): Add ItemsPanel to ComboBox to enable GroupStyle support#1645
pomianowski merged 1 commit intolepoco:mainfrom
frostybee:main

Conversation

@frostybee
Copy link
Contributor

This PR includes the following:

  • Fix ComboBox not rendering grouped items when using GroupStyle (only headers were showing, items were missing)
  • Add ItemsPanel property with StackPanel to the ComboBox style to enable proper group rendering
  • Add Gallery example demonstrating ComboBox with grouped items

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

When using GroupStyle with a ComboBox, only the group headers would display: the actual items within each group were missing. This was because the ComboBox style was missing an ItemsPanel property that ListBox already had.

Issue Number: N/A

What is the new behavior?

Added the ItemsPanel setter to ComboBox.xaml:

<Setter Property="ItemsPanel">
  <Setter.Value>
	  <ItemsPanelTemplate>
		  <StackPanel />
	  </ItemsPanelTemplate>
  </Setter.Value>
</Setter>

A simple StackPanel is used instead of VirtualizingStackPanel because virtualization can conflict with GroupStyle rendering, and ComboBox dropdowns typically have fewer items where virtualization isn't needed.

Test plan

  • Open Gallery app → BasicInput → ComboBox page
  • Verify the "grouped items" example shows both group headers AND items
  • Verify scrolling works with the scrollbar visible
  • Test in both light and dark themes

Other information

image

ComboBox was not rendering grouped items when using GroupStyle: only
headers would display while items were missing. Added ItemsPanel with
StackPanel to the ComboBox style to fix this behavior.

Also added a grouped items example to the Gallery app for demonstration.
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request gallery WPF UI Gallery dotnet release labels Jan 12, 2026
Copy link

@byrdthomas2013-source byrdthomas2013-source left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frostybee:main

@pomianowski pomianowski merged commit 7a89930 into lepoco:main Jan 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet gallery WPF UI Gallery PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants