Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3755856
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:45:45+00:00 2026-05-19T09:45:45+00:00

I have a listbox that is grouping the items with a GroupStyle. I would

  • 0

I have a listbox that is grouping the items with a GroupStyle. I would like add a control at the bottom of the stackpanel that holds all of the groups. This additional control needs to be part of the scrolling content so that the user would scroll to the bottom of the list to see the control. If I were using a listbox without the groups, this task would be easy by modifying the ListBox template. However, with the items grouped, the ListBox template seems to only apply on a per group basis. I can modify the GroupStyle.Panel, but that doesn’t allow me to add items to that panel.

<ListBox>
<ListBox.ItemsPanel>
    <ItemsPanelTemplate>
        <WrapPanel/>
    </ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.GroupStyle>
    <GroupStyle>
         <GroupStyle.Panel>
             <ItemsPanelTemplate>
                 <VirtualizingStackPanel/>  **<----- I would like to add a control to this stackpanel**
             </ItemsPanelTemplate>
         </GroupStyle.Panel>
        <GroupStyle.ContainerStyle>
            <Style TargetType="{x:Type GroupItem}">
                <Setter Property="Template">
                     <Setter.Value>
                         <ControlTemplate TargetType="{x:Type GroupItem}">
                              <Grid>
                                  <ItemsPresenter />
                              </Grid>
                         </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </GroupStyle.ContainerStyle>
    </GroupStyle>
</ListBox.GroupStyle>

This should give an idea of what I need to do:

GroupStyleNeeds

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:45:46+00:00Added an answer on May 19, 2026 at 9:45 am

    You can use the strategy you were planning on for a ListBox, just do it for a GroupItem instead. If you add this XAML to your GroupStyle, it will add an end-of-group TextBlock:

    <GroupStyle.ContainerStyle>
        <Style TargetType="GroupItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <StackPanel>
                            <ContentPresenter/>
                            <ItemsPresenter Margin="5,0,0,0"/>
                            <TextBlock Text="*** End of group ***"/>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </GroupStyle.ContainerStyle>
    

    Edit:

    Here is a complete XAML-only example of a grouped list with a scrollbar and additional content added to the end of the scrolling region:

    <Grid Height="100">
        <Grid.Resources>
            <PointCollection x:Key="sampleData">
                <Point X="1" Y="1"/>
                <Point X="1" Y="2"/>
                <Point X="2" Y="3"/>
                <Point X="2" Y="4"/>
                <Point X="3" Y="5"/>
                <Point X="3" Y="6"/>
            </PointCollection>
            <CollectionViewSource x:Key="groupedSampleData" Source="{StaticResource sampleData}">
                <CollectionViewSource.GroupDescriptions>
                    <PropertyGroupDescription PropertyName="X" />
                </CollectionViewSource.GroupDescriptions>
            </CollectionViewSource>
        </Grid.Resources>
        <ListBox ItemsSource="{Binding Source={StaticResource groupedSampleData}}">
            <ListBox.Template>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <ScrollViewer CanContentScroll="True">
                        <StackPanel>
                            <ItemsPresenter/>
                            <TextBlock Text="*** End of list ***"/>
                        </StackPanel>
                    </ScrollViewer>
                </ControlTemplate>
            </ListBox.Template>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Y}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.GroupStyle>
                <GroupStyle>
                    <GroupStyle.Panel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel/>
                        </ItemsPanelTemplate>
                    </GroupStyle.Panel>
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Margin="4" FontWeight="Bold" FontSize="15" Text="{Binding Path=Name}"/>
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                </GroupStyle>
            </ItemsControl.GroupStyle>
        </ListBox>
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listbox containing all the items and a second listbox that will
I have a ListBox that during development I had the items in the ListBox
I have a listbox that displays Shipment Items (custom class) that are formatted using
I have a ListBox control that I want to change into having a toggle
I have a listbox that users can add/remove from. To add, there's a text
I have a Listbox that allows user to select multiple items. Normally user can
I have a ListBox that is a drop target of items from other sources.
I have a ListBox that gets populated with items read from a JSON response.
I have a ListBox that each of its items has a button, I set
I have a ListBox that contains a number of User items that are DataTemplate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.