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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:30:09+00:00 2026-05-26T16:30:09+00:00

Check this xaml: <Window x:Class=MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:sys=clr-namespace:System;assembly=mscorlib Width=300> <ListBox HorizontalContentAlignment=Stretch Grid.IsSharedSizeScope=True> <ListBox.ItemsSource> <x:Array

  • 0

Check this xaml:

<Window
  x:Class="MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
  Width="300">
  <ListBox HorizontalContentAlignment="Stretch"
      Grid.IsSharedSizeScope="True">
    <ListBox.ItemsSource>
      <x:Array Type="{x:Type sys:Int32}">
        <sys:Int32>25</sys:Int32>
        <sys:Int32>10</sys:Int32>
        <sys:Int32>50</sys:Int32>
        <sys:Int32>30</sys:Int32>
        <sys:Int32>80</sys:Int32>
      </x:Array>
    </ListBox.ItemsSource>
    <ListBox.ItemContainerStyle>
      <Style TargetType="ListBoxItem"
           BasedOn="{StaticResource {x:Type ListBoxItem}}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
      </Style>
    </ListBox.ItemContainerStyle>
    <ListBox.ItemTemplate>
      <DataTemplate>
        <Grid Background="#FFE41515">
          <Grid.ColumnDefinitions>
            <ColumnDefinition SharedSizeGroup="name" Width="Auto"/>
            <ColumnDefinition SharedSizeGroup="value"/>
          </Grid.ColumnDefinitions>

          <TextBlock Text="Value:"/>
          <ProgressBar
              Value="{Binding Mode=OneWay}"
              Grid.Column="1" 
              HorizontalAlignment="Stretch"
              HorizontalContentAlignment="Stretch"/>
        </Grid>
      </DataTemplate>
    </ListBox.ItemTemplate>
  </ListBox>
</Window>

Here’s the output, notice that the ProgressBar isn’t stretched, why?
If the items are red, it means that each item fills the entire width, then why isn’t the ProgressBar stretching??
enter image description here

  • 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-26T16:30:09+00:00Added an answer on May 26, 2026 at 4:30 pm

    If you have only SharedSizeGroups the rest space will never be taken, they always behave like Width="Auto" (size to content) with the restriction of the largest item. As you only have two columns you do not even need two such groups as the second will already be the same width in every item, right?

    How about this instead:

      <Grid.ColumnDefinitions>
        <ColumnDefinition SharedSizeGroup="name" Width="Auto"/>
        <ColumnDefinition /> <!-- Implicit: Width="*" -->
      </Grid.ColumnDefinitions>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Check this example before reading the question - http://www.sqlfiddle.com/#!2/fcf3e/8 The following data comes from
check this out: template <class T> class Test: public T { public: void TestFunc()
Please check this: http://img62.imageshack.us/img62/3598/ieff.png why is it more height than in FF.. i want
check this example: > a = matrix(1:9, nrow = 3, ncol = 3, dimnames
Check this code (My Custom Keyboard): -(IBAction) updateTextBackSpace:(id)sender { if([txtview.text length]>0) { NSString *deletedLastCharString
Check this link! I am having the hardest time trying to figure out why
Please check this code out it compiles and runs absolutely fine.. The question is
Guys check this website on FF and Chrome For some reason(s), jQuery isn't working
Hola check this code. var watch = new Stopwatch(); watch.Start(); var request = HttpWebRequest.Create(new
Can you guys please check this code, it is MVC3 Razor <p><strong><u>Skills:</u></strong> @foreach (var

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.