tags:

views:

25

answers:

1

Hi,

My Mainpage has a menu that loads usercontrols into a Stackpannel. I've got several usercontrols and some of them have a datagrid. But when I bind a large collection to the datagrid, the datagrid gets much larger than the usercontrol. How can I set the max width/height of the grid to the size of the usercontrol. It seems that the usercontrol's size also gets very large because of the size of the grids.

The mainpage had a Grid control:

The usercontrols are added to the ContainerSP

thanks!

Filip

+1  A: 

StackPanel assumes unlimited canvas, if you really want to control dynamic sizing, use a grid instead

vc 74
It doesn't work, I replaced the stackpanels by grids, but the DataGrid in the UserControl is still larger than the window
Filip
Did you specify 1* as the grid's columns width (not auto)?
vc 74
OK, I used Auto in one place, thanks
Filip