[UWP][XAML] ListView child item not using full width
<p>I'm trying to display a list of bound items.  I've customized the datatemplate to be a grid and I want the right column (that has a fixed width) to stick to the right side of the screen, and the 1st column I want to fill the remaining space.  Normally this works fine, but when I put this grid inside a ListView, the behavior seems to change.  Below is my ListView code:</p>
<pre class="lang-xaml prettyprint-override"><code>    &lt;ListView x:Name=&quot;LView&quot; Background=&quot;Green&quot; Width=&quot;{Binding ElementName=ExtPropPage, Path=Width}&quot; ItemsSource=&quot;{Binding CurrentSensor.ExtendedProperties, Mode=TwoWay}&quot; Margin=&quot;5&quot; HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Center&quot;&gt;
                &lt;ListView.ItemTemplate&gt;
                    &lt;DataTemplate &gt;
                        &lt;Grid Background=&quot;BlueViolet&quot; Width=&quot;{Binding ElementName=LView, Path=Width}&quot; HorizontalAlignment=&quot;Center&quot; &gt;
                            &lt;Grid.ColumnDefinitions&gt;
                                &lt;ColumnDefinition Width=&quot;*&quot;/&gt;
                                &lt;ColumnDefinition Width=&quot;100&quot;/&gt;
                            &lt;/Grid.ColumnDefinitions&gt;
                            &lt;Grid Grid.Column=&quot;0&quot; Background=&quot;Blue&quot; HorizontalAlignment=&quot;Stretch&quot;&gt;
                                &lt;Grid.RowDefinitions&gt;
                                    &lt;RowDefinition Height=&quot;*&quot;/&gt;
                                    &lt;RowDefinition Height=&quot;*&quot;/&gt;
                                &lt;/Grid.RowDefinitions&gt;
                                &lt;TextBlock Grid.Row=&quot;0&quot; FontWeight=&quot;Bold&quot; FontSize=&quot;12&quot; Text=&quot;{Binding KeyId, Mode=TwoWay, Converter={StaticResource ExtPropConverter}}&quot; HorizontalAlignment=&quot;Center&quot; VerticalAlignment=&quot;Center&quot;/&gt;
                                &lt;TextBlock Grid.Row=&quot;1&quot; FontWeight=&quot;Normal&quot; FontSize=&quot;10&quot; Text=&quot;{Binding JsonValue, Mode=TwoWay}&quot; TextWrapping=&quot;Wrap&quot; HorizontalAlignment=&quot;Center&quot; VerticalAlignment=&quot;Center&quot;/&gt;
                            &lt;/Grid&gt;
                            &lt;StackPanel Grid.Column=&quot;1&quot; Orientation=&quot;Horizontal&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Right&quot; BorderBrush=&quot;{x:Null}&quot; Background=&quot;Red&quot;&gt;
                                &lt;Button DataContext=&quot;{Binding}&quot; ToolTipService.ToolTip=&quot;Edit&quot; Click=&quot;ButtonHandler&quot; BorderBrush=&quot;DarkGray&quot; FontFamily=&quot;Segoe MDL2 Assets&quot; Content=&quot;&amp;#xE70F;&quot; Style=&quot;{StaticResource CircleButtonStyle}&quot;&gt;

                                &lt;/Button&gt;
                                &lt;Button x:Name=&quot;DeviceCancelButton&quot; ToolTipService.ToolTip=&quot;Delete&quot; view:EventHandlers.Attach=&quot;Click&quot; Click=&quot;DeleteExtProp&quot; BorderBrush=&quot;DarkGray&quot; FontFamily=&quot;Segoe MDL2 Assets&quot; Content=&quot;&amp;#xE74D;&quot; Style=&quot;{StaticResource CircleButtonStyle}&quot;&gt;

                                &lt;/Button&gt;
                            &lt;/StackPanel&gt;


                        &lt;/Grid&gt;
                    &lt;/DataTemplate&gt;
                &lt;/ListView.ItemTemplate&gt;
                
            &lt;/ListView&gt;
</code></pre>
<p>I've put colors on the background of several of the elements to get a better idea of where one control's bounds are versus another's.  What I can see so far is that the ListView expands to fill the whole screen width, which is great, but when it comes to the items in the list view (grids), the items in column 1 are varying in length (when more than 1 item is populated), and it seems the grid's use of space is depending on the width of the objects within them, rather than relying on the fact that I've used <code>Width=&quot;*&quot;</code> which should be telling the column to expand and fill available space, regardless of what is in the column itself.</p>
<p>I've done lots of searching and found answer after answer pertaining to the use of <code>HorizontalAlignment=&quot;Stretch&quot;</code> and either I'm using it in the wrong places or I'm missing something else all together.</p>
<p>Note:  The code above is not necessarily indicative of being the only solution I've tried, the varying attempts at adjusting widths and alignments would make this post huge, so hopefully someone has an answer that is not something I've tried that results in no success.</p>
<p>Thanks for the help.</p>
<p>P.S.  As an additional bonus to any answer, I'd like to override the &quot;OnMouseOver&quot; property to stop the changing of the background when I hover over the listviewitem.  I don't need anything special to happen when I'm hovering over these.</p>