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

  • Home
  • SEARCH
  • 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 203463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:22:52+00:00 2026-05-11T17:22:52+00:00

I have the following XAML for a databound items control to show a list

  • 0

I have the following XAML for a databound items control to show a list of groups, with a label and button to add a new group appearing first:

<WrapPanel Orientation="Horizontal">
    <Label Content="Groups" />
    <Button x:Name="btnGroupAdd" Click="btnGroupAdd_Click" Content="+" />
    <ItemsControl ItemsSource="{Binding}" x:Name="_groupList" >
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel Orientation="Horizontal">
                </WrapPanel>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Border Padding="3" BorderThickness="1">
                    <WrapPanel>
                        <CheckBox x:Name="_groupEnabled" Click="GroupEnabled_Click" IsChecked="{Binding Path=Checked}">
                            <TextBlock x:Name="_groupName" Text="{Binding Path=Group.Name}" ></TextBlock>
                        </CheckBox>
                        <Button x:Name="_deleteGroup" FontStyle="Normal" Click="DeleteGroup_Click" />
                    </WrapPanel>
                </Border>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>

With a small number of groups, everything appears on one line.

Groups + Group1 Group2 Group3

When I add more groups, the wrap panel containing the items wraps, but the initial label and button to add a new group is on its own row, with the databound groups starting on the next row.

Groups +
Group1 Group2 Group3 Group4
Group5

I can understand why this is happening, as the wrap panels are nested. My question is: how do I include the first label and button in the inner wrap panel so that they aren’t on a row on their own?

Groups + Group1 Group2 Group3
Group4 Group5

  • 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-11T17:22:52+00:00Added an answer on May 11, 2026 at 5:22 pm

    If you’re happy with this:

    Groups + Group1 Group2 Group3
                    Group4 Group5

    Then I would suggest using an outer Grid and an inner WrapPanel. Otherwise, your options are:

    1. Include the other controls (Label and Button) or a view model reprenting those controls in the collection you’re binding to.
    2. Write your own Panel.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xaml for changing the image for WPF button when mouse
I am NEW to WPF. I have the following XAML code: </Window> ... <Canvas>
I have the following XAML (simple list box with custom DataTemplate). I'm trying to
I have the following xaml for WPF ListBox control. I have customized it so
I have the following xaml which resides in a wpf user control - <Grid>
I have the following xaml for the MS Bing Maps control. ZoomLevel is bound
I have the following XAML: <sdk:Label Content={Binding RefreshTextToggle, Converter={StaticResource enumToText}, ConverterParameter=ItemsOfInterest,FallbackValue='Please select items of
I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
I have the following xaml: <DockPanel> <DockPanel.Resources> <Style TargetType=Button> <Style.Triggers> <Trigger Property=IsMouseOver Value=True> <Setter
I have the following XAML/Control Template for a ListViewItem: <Window.Resources> <ControlTemplate x:Key=ItemTemplate TargetType=ListViewItem> <Border

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.