Skip to content

feat(controls): Switch from StackPanel to VirtualizingStackPanel in ComboBox to prevent long load times#1703

Open
steven-norris wants to merge 4 commits intolepoco:mainfrom
steven-norris:patch-1
Open

feat(controls): Switch from StackPanel to VirtualizingStackPanel in ComboBox to prevent long load times#1703
steven-norris wants to merge 4 commits intolepoco:mainfrom
steven-norris:patch-1

Conversation

@steven-norris
Copy link
Copy Markdown

@steven-norris steven-norris commented May 1, 2026

StackPanel to VirtualizingStackPanel to prevent long load times and UI lockups when the ComboBox binding contains sufficiently large list of 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?

In the last update this was changed to include a in the item template of the ComboBox, this should be a to avoid long load times and UI lockups, only drawing what is visible to the user at open/scroll time.

Issue Number: N/A

What is the new behavior?

UI only loads/draws what is requested by the user. This is a long-known issue w/ComboBox.

StackPanel to VirtualizingStackPanel to prevent long load times and UI lockups when the ComboBox binding contains sufficiently large list of items.
@steven-norris steven-norris requested a review from pomianowski as a code owner May 1, 2026 20:12
@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 release labels May 1, 2026
@steven-norris
Copy link
Copy Markdown
Author

Added issue #1704 with more information on the problem.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Wpf.Ui library ComboBox control template to improve dropdown performance when bound to large item sources by moving toward UI virtualization.

Changes:

  • Replaced the ComboBox ItemsPanelTemplate from StackPanel to VirtualizingStackPanel in the default ComboBox style.

Comment thread src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml Outdated
@pomianowski pomianowski changed the title Update ComboBox.xaml feat(controls): Switch from StackPanel to VirtualizingStackPanel in ComboBox to prevent long load times May 4, 2026
I failed when I updated this code on my phone.
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. PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants