Grid with Column Definition and Row definition : Grid Row Column « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » Grid Row Column 
24.43.4.Grid with Column Definition and Row definition
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Grid" Height="300" Width="300">
    <Grid Background="AliceBlue">
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="100" MaxWidth="200" />
            <ColumnDefinition MaxWidth="100" />
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition MinHeight="100" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Ellipse Grid.Row="0" Grid.Column="0" Fill="BlanchedAlmond" Stroke="Black" />
        <Ellipse Grid.Row="0" Grid.Column="1" Fill="BurlyWood"  Stroke="Black" />
        <Ellipse Grid.Row="0" Grid.Column="2" Fill="Red" Stroke="Black" />
        <Ellipse Grid.Row="0" Grid.Column="3" Fill="BurlyWood" Stroke="Black" />
        <Ellipse Grid.Row="1" Grid.Column="0" Fill="BurlyWood" Stroke="Black" />
        <Ellipse Grid.Row="1" Grid.Column="1" Fill="Red" Stroke="Black" />
        <Ellipse Grid.Row="1" Grid.Column="2" Fill="BurlyWood" Stroke="Black" />
        <Ellipse Grid.Row="1" Grid.Column="3" Fill="BlanchedAlmond" Stroke="Black" />
        <Ellipse Grid.Row="2" Grid.Column="0" Fill="BlanchedAlmond" Stroke="Black" />
        <Ellipse Grid.Row="2" Grid.Column="1" Fill="Red"  Stroke="Black" />
        <Ellipse Grid.Row="2" Grid.Column="2" Fill="BlanchedAlmond" Stroke="Black" />
        <Ellipse Grid.Row="2" Grid.Column="3" Fill="BurlyWood" Stroke="Black" />
        <Ellipse Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Fill="Gold"  Stroke="Black" Height="50"/>
    </Grid>
</Window>
WPF Grid With Column Definition And Row Definition
24.43.Grid Row Column
24.43.1.ColumnDefinition.Width=AutoColumnDefinition.Width=Auto
24.43.2.ColumnDefinition.Width=*ColumnDefinition.Width=*
24.43.3.Bind to Grid Width and HeightBind to Grid Width and Height
24.43.4.Grid with Column Definition and Row definitionGrid with Column Definition and Row definition
24.43.5.Define rows / columns for GridDefine rows / columns for Grid
24.43.6.Using Grid.ColumnSpanUsing Grid.ColumnSpan
24.43.7.Set Grid Row Height and Column Width to AutoSet Grid Row Height and Column Width to Auto
24.43.8.Mixing row height stylesMixing row height styles
24.43.9.Set Column and Row index when adding Controls to a GridSet Column and Row index when adding Controls to a Grid
24.43.10.Empty RowDefinition and ColumnDefinitionEmpty RowDefinition and ColumnDefinition
24.43.11.Automatic Width and HeightAutomatic Width and Height
24.43.12.Span The Cells
24.43.13.Split Grid
24.43.14.Add controls to a Grid with loop
24.43.15.Set Grid Margin
24.43.16.Using Grid to layout all controls
24.43.17.Add control to specific row and column
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.