locked
Layout and Grid RRS feed

  • Question

  • Good Morning,

    I'm designing my SL layout with a Grid, and it's like this:

    <Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="100"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition ></ColumnDefinition>
                <ColumnDefinition Width="300"></ColumnDefinition>
            </Grid.ColumnDefinitions>
        </Grid>

      

    When i'm in VS 2010, in preview it shows me the left column with 300 pixeis, and the right one with all left space. But when i run the App, the column with the 300 pixeis it's the right (i see it from GridLines).
    Am i doing something wrong? By the way, is this the proper way to create a layout?

    Thanks

    Monday, February 8, 2010 5:38 AM

Answers

  • Hello Guilherme!

    Your Grid, as I understand, should be defined as:

     

    <Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">
           

    <Grid.RowDefinitions>

    <RowDefinition Height="100"/> --> first row (on top) has 100px height

    <RowDefinition Height="*"/> --> second row (on bottom) sizes THE REST of the window available height

    </Grid.RowDefinitions>


    <Grid.ColumnDefinitions>


    <ColumnDefinition Width="300"/> --> the first column (on the left) has 300px width
    <ColumnDefinition Width="*"/> --> the second column (on the right) sizes THE REST of the window available width
    </Grid.ColumnDefinitions>


    </Grid>

     

    Hope this helps!

     

    If this reply helped you, please mark it as correct.

    Monday, February 8, 2010 6:14 AM

All replies

  • Hello Guilherme!

    Your Grid, as I understand, should be defined as:

     

    <Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">
           

    <Grid.RowDefinitions>

    <RowDefinition Height="100"/> --> first row (on top) has 100px height

    <RowDefinition Height="*"/> --> second row (on bottom) sizes THE REST of the window available height

    </Grid.RowDefinitions>


    <Grid.ColumnDefinitions>


    <ColumnDefinition Width="300"/> --> the first column (on the left) has 300px width
    <ColumnDefinition Width="*"/> --> the second column (on the right) sizes THE REST of the window available width
    </Grid.ColumnDefinitions>


    </Grid>

     

    Hope this helps!

     

    If this reply helped you, please mark it as correct.

    Monday, February 8, 2010 6:14 AM
  • Thanks ootamir

    As this topic is about layout, i would like to ask you one thing

    I'm now introducing to SL to develop an darshboard sales, but i haven't understand yet the layout system of SL Application. In .NET i use masterpages, and in SL as far as i know, we create an user control (by default mainpage.xml) and we create anothers users controls according our needs.

    So the mainpage.xml will work as an masterpage of .NET. Am i correct?

    Thank you and i hope you understand my question, my english is horrible!

    Monday, February 8, 2010 7:05 AM
  •  Well i've answered my question reading this at MSDN: http://msdn.microsoft.com/en-us/library/cc645025%28VS.95%29.aspx

    Thanks for the help, problem solved!

    Monday, February 8, 2010 7:09 AM