I have a listbox within listbox and when I try to reduce the height of the window the scrollbar for the listbox does not appears up. I want to dispaly the scrollbar on the outer listbox because the outerlistbox can have multiple innner listboxes. here is the XAML I am using. Can anybody let me know what is the issue?
<ListBox Name="MasterListBox" HorizontalAlignment="Stretch" Width="200">
<ListBoxItem >
<ListBox Name="Child1" BorderBrush="{x:Null}">
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
<ListBoxItem Content="testing item1" />
<ListBoxItem Content="testing item2" />
<ListBoxItem Content="testing item3" />
</ListBox>
</ListBoxItem>
</ListBox>
If I am getting you right, you dont want the inner listboxes to scroll.
There are two ways to achieve that:
1) Change inner listbox to ItemsPanel. 2) If you really need to preserve the inner control as ListBox you have to replace the ScrollViewer with a ContentPresenter in the Template of the inner Listbox control. See this link (it`s marked as correct answer) > http://forums.silverlight.net/t/193872.aspx/1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With