tags:

views:

110

answers:

1

I have a grid in Silverlight 3. The height of the grid row is set to "Auto". I have a ListBox in one of the grid cells. I want this listbox to fill 100% of the available space, even if it does not have enough items to do so. Currently, I have the ListBox height set to "Auto", and it will expand as items are added, and display a scroll bar when it reaches the size of the cell.

Any help is appreciated.

+1  A: 

Set the vertical alignment on the Listbox, and remove the grid height being Auto, that is going to restrict the growth to what is absolutely needed.

VerticalAlignment = "Stretch"
Andrew
You are correct. It turns out that the problem was that I had it inside a StackPanel, which cannot be stretched. I used a DockPanel instead, and it is working now. Thank you for your help.
Sako73
Slightly concerned that you are saying the stack panel cannot be stretched; can you show the code? You can certainly set the stack panel's vert/horiz alignment to stretch and then put in a couple controls or even just one. Perhaps I've just misunderstood.-jesse
Jesse Liberty
Did seem odd and Jesse would be right that a stack panel should stretch, unless explicit height / width had been set (depending on oritentation.)
Andrew