Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight grid (panel) 2 columns 50%/50%

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...

like image 380
Julian de Wit Avatar asked Aug 28 '10 05:08

Julian de Wit


1 Answers

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>
like image 75
Henk Holterman Avatar answered Sep 30 '22 04:09

Henk Holterman