Reputation: 3094
Hello I want a silverlight grid layout panel.
The width should be 100%.
There should be 2 columns that both take 50%.
In the columns there should be buttons that take 100% of the column cell..
Somehow I mess it up all the time and cannot find a way to do this.
Gridpanel is not a must... Stackpanel or whatever is fine too..
One more thing.. the grid is contained in a stackpanel
If nothing works.. code is fine too..
-------Stackpanel--------
|---griddpanel-100%-----|
||50% |50% ||
||Button100%|Button100%||
|-----------------------|
-------------------------
Thanks for any help...
Upvotes: 5
Views: 4382
Reputation: 273209
This should do it it:
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="50*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0">B1</Button>
<Button Grid.Column="1">B2</Button>
</Grid>
</StackPanel>
Upvotes: 8