Note that there are some explanatory texts on larger screens.

plurals
  1. POXAML Listbox alignment issue
    primarykey
    data
    text
    <p>I have a <strong>Windows Phone 8 page</strong> with Country Names on left and ISD codes on right. I want to align the country name to the extreme left and ISD code to the extreme right of the screen.</p> <p>For this, I wrote the following XAML</p> <pre><code>&lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt; &lt;ListBox ItemsSource="{Binding IsdCodes}" HorizontalAlignment="Stretch" Background="Blue"&gt; &lt;ListBox.ItemContainerStyle&gt; &lt;Style TargetType="ListBoxItem"&gt; &lt;Setter Property="HorizontalAlignment" Value="Stretch"/&gt; &lt;/Style&gt; &lt;/ListBox.ItemContainerStyle&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;Grid HorizontalAlignment="Stretch" Background="Yellow" ShowGridLines="True"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="3*"/&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBox Grid.Column="0" HorizontalAlignment="Stretch" Text="{Binding Key}" /&gt; &lt;TextBox Grid.Column="1" HorizontalAlignment="Stretch" Text="{Binding Value}" /&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; &lt;/Grid&gt; </code></pre> <p>But the output I am getting is as follows : <img src="https://i.stack.imgur.com/myu3D.png" alt="output screenshot"></p> <p>As I gave the grid column widths as 3* and *, I expected first column to occupy 75% of the width of the screen on left and 2nd column to occupy 25% of the width of the screen on the right. But I do see that listbox item still doesn't occupy the entire screen width (Assumed from the yellow background).</p> <p>Where did I go wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload