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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:37:24+00:00 2026-05-25T22:37:24+00:00

To keep things simple all i am trying to do is to place a

  • 0

To keep things simple all i am trying to do is to place a listbox and a button below it. Although it seems simple it isn’t. It is not, because it is in a GRID…

The row size is star size and listbox having verticalAlign top works great all the time. The problem is that I cannot add a button below it. Having a grid with 2 rows one star height and the other auto would place the button at the bottom of the form even if listbox contents are little. Trying to set both rows auto doesn’t work when resizing as no scrollbar is visible at the listbox…. Any workaround for this??

Update some code

 <Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"  />
           <RowDefinition Height="Auto" />
         </Grid.RowDefinitions>
    <DockPanel >

       <ListBox DockPanel.Dock="Top" Name="lbStaff"  ItemsSource="{Binding}"  
            Grid.Row="0" VerticalAlignment="Top" BorderThickness="0" 
               Background="WhiteSmoke" Margin="15,10,20,30" Style="{DynamicResource 
               ListBoxUsers}" ScrollViewer.VerticalScrollBarVisibility="Visible">
       <ListBox.Resources>
         <Style  TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource 
            ListBoxTest1}"></Style>
       </ListBox.Resources>
         <ListBox.ItemTemplate>
             <DataTemplate >
                 <StackPanel Margin="5,4,5,4">
                     <TextBlock   HorizontalAlignment="Stretch"  FontSize="16"><Run 
                     Text="{Binding Name}"/> - <Run Text="{Binding   Mode=OneWay, 
                     Path=PositionString}"/></TextBlock>
                     <TextBlock >Τηλέφωνο <Run Text="{Binding Phone}"/>
                 </TextBlock>
                 </StackPanel>

             </DataTemplate>
           </ListBox.ItemTemplate>
  </ListBox>
     <Button DockPanel.Dock="Top" Grid.Row="0"   HorizontalAlignment="Right" 
       VerticalAlignment="Top"  Margin="0,10,7,0" Style="{DynamicResource 
        ButtonStyleNew1}">
       <Button.Content>
           <StackPanel Orientation="Horizontal">
               <Image Source="/WpfApplication1;component/Images/filenew1.png" 
               Stretch="None" VerticalAlignment="Center"></Image>
               <TextBlock Margin="5,0,0,0" FontSize="16">Προσθήκη Χρήστη</TextBlock>
          </StackPanel>
      </Button.Content>
     </Button>
  </DockPanel>                       

</Grid>

</Grid>
  • 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-25T22:37:25+00:00Added an answer on May 25, 2026 at 10:37 pm

    I solved this problem using a dockpanel. I docked buttons at bottom and then i let listbox to fill the remaining area..(lastchildfill=true) …

    It works fine…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To keep things simple, we have a few aspx pages... Page1.aspx - resets Session
To keep things simple, please allow the assumption that some code requires the use
For various reasons, such as cookies, SEO, and to keep things simple, I would
We're using Prototype for all of our Ajax request handling and to keep things
I keep reading about C99 and C++11 and all these totally sweet things that
I am trying to make a simple script that will remove all unnecessary whitespace
I'm trying to create a simple data entry application for the Mac (not iPhone).
To keep things simplified lets say I have an interface RandomProvider interface public interface
I want to keep logs of some things that people do in my app,
In Eclipse RCP way of doing things, where should I keep my model objects?

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.