Is there a way (without codebehind) to make a WPF ListView grow to the width or height of its contents rather than scroll? Sort of like a StackPanel only still selectable.
For instance, if I have:
<ScrollViewer>
<StackPanel>
<ListView ItemsSource="{Binding Rail1}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
<ListView ItemsSource="{Binding Rail2}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</StackPanel>
</ScrollViewer>
the ScrollViewer does not show a horizontal scroll bar, instead the ListViews do.
ListViews? Or some special data inRail1,Rail2? Your sample works fine if you addHorizontalScrollBarVisibility="Auto"into scrollViewer. - Snowbear