# Grid with Rectangle and GeometryDrawing : Grid « Windows Presentation Foundation « C# / CSharp Tutorial

```<Window x:Class="WPFBrushes.ColorAndAlpha"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Alpha Channel" Height="300" Width="300">
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">

<Rectangle Height="200" Width="200">
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,10,10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="Red" Geometry="M0,10 L 0,0 10,0 10,1 1,1 1,10Z">
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>

</Grid>

</Window>
```
 24.42.Grid 24.42.1. Simple Grid.xaml 24.42.2. Use Grid to layout a Calendar 24.42.3. Grid with Rectangle and GeometryDrawing 24.42.4. Set Grid Row and Column for a Button 24.42.5. Arrange UI Elements in a Grid 24.42.6. Align Ellipses along with Grid 24.42.7. Show Grid Lines 24.42.8. Multiple Items in a Grid Cell 24.42.9. Grid in ScrollViewer 24.42.10. Margin vs Padding and Grid 24.42.11. Window with Grid 24.42.12. Arrange the children for Grid 24.42.13. Put more than one Object to one Grid Cell 24.42.14. Nested Grid 24.42.15. Shared Size Group 24.42.16. Use the Grid element to create a standard user interface (UI) dialog box. 24.42.17. Place and size rectangles and ellipses in Grid cells 24.42.18. Use Image as the Grid background 24.42.19. Grid with SharedSizeGroup 24.42.20. Layout a Form with StackPanel and Grid 24.42.21. Layout Controls with Grid in code