0
votes

When I have Grid in Silverlight, and I provide Column Definitions like below

    <Grid.ColumnDefinitions>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>            
    </Grid.ColumnDefinitions>

For some reason the items that get placed in those columns get cut off. That is I only see half the control. But when I do

   <Grid.RowDefinitions>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>

and put items in those respected rows I can see the entire items with their proper respective widths and heights.

What could I be overlooking?

Thanks

2

2 Answers

0
votes
<Grid.ColumnDefinitions> 
    <ColumnDefinition></ColumnDefinition> 
    <ColumnDefinition></ColumnDefinition>             
</Grid.ColumnDefinitions> 

is actually just a short cut for

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.5*"/>
            <ColumnDefinition Width="0.5*"/>
        </Grid.ColumnDefinitions>

which means, you have two columns in this Grid, each takes 50% of the width.

Same way,

   <Grid.RowDefinitions>         
        <RowDefinition></RowDefinition>         
        <RowDefinition></RowDefinition>         
    </Grid.RowDefinitions>

is the same as

        <Grid.RowDefinitions>
            <RowDefinition Height="0.5*"/>
            <RowDefinition Height="0.5*"/>
        </Grid.RowDefinitions>

Hope this helps. :)

-1
votes