Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Getting ListView items to exand to width of ListView

 
 
Old 11-29-2006   #1 (permalink)
John Dunn


 
 

Getting ListView items to exand to width of ListView

Is it possible to get the items placed inside of a ListView Control to
automatically expand to the full width of the Control? If I place them inside of
a StackPanel they expand but don't when placed inside of a ListView. Here's some
XAML that shows the problem.

<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/interactivedesigner/2006"
mc:Ignorable="d"
Background="#FFFFFFFF"
x:Name="DocumentRoot"
x:Class="UntitledProject1.Scene1"
Width="640" Height="480">

<ListView Margin="0,0,0,0" x:Name="ListView"
IsSynchronizedWithCurrentItem="True" VerticalAlignment="Top" Height="58">
<ComboBox Width="Auto" Height="Auto" x:Name="ComboBox"
IsSynchronizedWithCurrentItem="True">
<Label Width="Auto" Height="Auto" x:Name="Label" Content="Label"/>
<Label Width="Auto" Height="Auto" x:Name="Label1" Content="Label1"/>
<Label Width="Auto" Height="Auto" x:Name="Label2" Content="Label2"/>
<Label Width="Auto" Height="Auto" x:Name="Label3" Content="Label3"/>
</ComboBox>
</ListView>
<StackPanel VerticalAlignment="Top" Margin="0,200,0,0" Height="82"
x:Name="StackPanel">
<ComboBox Width="Auto" Height="Auto" x:Name="ComboBox1"
IsSynchronizedWithCurrentItem="True">
<Label Width="Auto" Height="Auto" x:Name="Label4" Content="Label4"/>
<Label Width="Auto" Height="Auto" x:Name="Label5" Content="Label5"/>
<Label Width="Auto" Height="Auto" x:Name="Label6" Content="Label6"/>
<Label Width="Auto" Height="Auto" x:Name="Label7" Content="Label7"/>
</ComboBox>
</StackPanel>
</Grid>

Thanks-

John

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
ListBox vs. ListView .NET General
ListView + ImageList PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46