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 6095141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:46:43+00:00 2026-05-23T12:46:43+00:00

I have the following xaml which resides in a wpf user control – <Grid>

  • 0

I have the following xaml which resides in a wpf user control –

<Grid>    
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>

        <TextBox 
            x:Name="MyTxt"
            TextWrapping="WrapWithOverflow" 
            Grid.Row="0"  
            />

        <ListView                 
            x:Name="MyList"
            ItemsSource="{Binding}"
            Grid.Row="1"
            />

        <Label
            Grid.Row="2"
            />
    </Grid>

This control is nested within a grid in a view. I would like to have the text box be a set height at the top of the grid, the label at the bottom showing as a fixed height at the bottom of the grid. I want the list view to fill the rest of the screen area.

The problem that I am having is the listview does not size correctly. If I have too many records that show up in it, it extends beyond the window and no scroll bars are available to scroll down. I therefore cannot get to the bottom to see the vertical scroll bar if the data stretches off to the right of the screen.

I was able to set the listview to a fixed height and that worked, but I would like it to be more dynamic and resize with the window if possible.

Does anyone have any tips that might get the sizing correct?

Thanks for any thoughts.

EDIT – Here is the xaml for the containing grid in the mainwindow view. this was adapted from the article by Josh Smith here

<Grid>
      <Border 
           Style="{StaticResource MainBorderStyle}"
           >
           <HeaderedContentControl
             Content="{Binding Path=Workspaces}"
             ContentTemplate="{StaticResource WorkspacesTemplate}"                  
             />
         </Border>
 </Grid>

I do have the scrollviewer properties set as mentioned in some of the answers below.
Here is the datatemplate for the workspace

<DataTemplate x:Key="WorkspacesTemplate">
        <TabControl 
      IsSynchronizedWithCurrentItem="True" 
      ItemsSource="{Binding}" 
      ItemTemplate="{StaticResource ClosableTabItemTemplate}"
      Margin="4"
      />
    </DataTemplate>
  • 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-23T12:46:44+00:00Added an answer on May 23, 2026 at 12:46 pm

    I was able to get it working. If I change the containing grid in the main window to use a ContentControl instead of a HeaderedcontentControl, it works as expected.

    Thank for any help.

    • 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: <Grid x:Name=ContentPanelDaily Grid.Row=1 <Grid.RowDefinitions> <RowDefinition Height=40 /> </Grid.RowDefinitions> <Grid.ColumnDefinitions>
I have a UserControl which contains the following XAML: <GroupBox> <Grid> <Button x:Name=btn Content=Test/>
I have the following XAML, which works fine in WPF, but not in Silverlight
I am converting some Silverlight XAML into WPF. I currently have a user control
I have the following XAML code as part of a custom control: <telerik:RadTreeView x:Name=treeModules>
Hi I have following XAML code which is the output from XamlWriter.Save(): <StackPanel Name=itemStack
I have the following XAML: <UserControl.Resources> <DataTemplate x:Key=ExpanderTemplate> <Grid> <Rectangle Stroke=Black StrokeThickness=1 Width=10 Height=10
I have the following XAML code: <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar IsVisible=True IsMenuEnabled=False x:Name=PageBar> <shell:ApplicationBarIconButton IconUri=/Assets/Icons/appbar.questionmark.rest.png Text=Help
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>

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.