Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox dropdown is empty when expanding for the first time when specifying ItemsPanelTemplate in order to add Grouping #1228

Closed
ottD opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
Milestone

Comments

@ottD
Copy link

ottD commented Jan 6, 2025

After upgrading from v9 to v10 of the Fluent.Ribbon library, we have noticed that the ComboBox control fails to render any items the first time a user is trying to expand the dropdown. Consecutive user interactions render the dropdown content as expected. We tracked this down to the ItemsPanelTemplate which we added a while ago (as described here (#309)) in order to support grouping of items using a Fluent:GalleryPanel (also see code sample below). Note that the issue goes away if we remove the custom ItemsPanelTemplate but then we lose the Grouping which we had with Fluent.Ribbon v9.
So is this still the recommended way of adding Grouping to comboBox items or is there another way in Fluent.Ribbon v10?

<Fluent:ComboBox Name="ViewComboBox" Height="Auto" HorizontalAlignment="Right" Size="Small" IsEditable="False" ScrollViewer.CanContentScroll="False"
                       ItemsSource ="{Binding Path=LocationViews, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type l:FileList}}}"
                       SelectedValue ="{Binding Path=SelectedView, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type l:FileList}}}"
                       SelectionChanged="ViewComboBox_OnSelectionChanged"
                       MinWidth= "150" MaxWidth="250" VerticalContentAlignment="Center" >
    <Fluent:ComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <Fluent:GalleryPanel IsGrouped="True" GroupBy="Group"
                                 ItemContainerGenerator="{Binding ItemContainerGenerator, RelativeSource={RelativeSource FindAncestor, AncestorType=Fluent:ComboBox}}" />
        </ItemsPanelTemplate>
    </Fluent:ComboBox.ItemsPanel>
</Fluent:ComboBox>

First click on comboBox shows no items in dropdown:
image

Closing the dropdown and clicking again on comboBox shows dropdown items with Grouping as expected :
image


Environment

  • Fluent.Ribbon v10.1.0
  • Windows 11
  • .NET Framework 4.8
@batzen batzen self-assigned this Feb 6, 2025
@batzen batzen added the Bug 🐞 label Feb 6, 2025
@batzen batzen added this to the 11.0 milestone Feb 6, 2025
@batzen
Copy link
Member

batzen commented Feb 6, 2025

Not sure why it doesn't render sometimes, but i found a way to repro this in the showcase application.

@batzen batzen closed this as completed in b1abcb7 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants