C# - WPF Grid Example with ColumnSpan


C# - WPF Grid Example with ColumnSpan

What is XAML?

XAML, which stands for eXtensible Application Markup Language, XAML is very much like HTML on steroids; that is, you can not only use it as a simple markup language, but you can add a great deal of declarative functionality as well and we're going to see how that works and what that means as we explore XAML.

C# Grid Rows and Columns in WPF

In the previous wpf article you learned about what is WPF, what are the benefits of using WPF in C# and WPF Sample Application for absolute beginners. Now moving to the next step working with WPF controls. In this tutorial we will learn how to work with WPF Grid Control, Grid.RowDefinitions, Grid.ColumnDefinitions and Grid.ColumnSpan. The following wpf example demonstrate all about wpf grid layout in C#. Find the below XAML code :
WPF Grid,wpf grid control,wpf controls,wpf grid example,wpf example,wpf gridview,
WPF Example 1 - wpf gridview rows
<Window x:Class="LayoutWithGrids.MainWindow"
        Title="MainWindow" Height="350" Width="625">
         <RowDefinition Height="*" />
         <RowDefinition />
         <RowDefinition Height="2*" />
         <RowDefinition Height="2*" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
         <ColumnDefinition Width="*" />
         <ColumnDefinition Width="2*" />
         <Rectangle Fill="Red"
                 Grid.Row="0" />
      <Rectangle Fill="Orange"
      <Rectangle Fill="Yellow"
                 Grid.Row="1" />
      <Rectangle Fill="Green"
      <Rectangle Fill="Blue"
                 Grid.Row="2" />
      <Rectangle Fill="Indigo"
      <Rectangle Fill="Violet"
                 Grid.Row="3" />
      <Rectangle Fill="Black"
                 Grid.Column="1" />
      <Label Content="Working with Grid Rows and Columns using Rectangles"
      <Rectangle Fill="Wheat"
                 Grid.Row="5" />
      <Rectangle Fill="Purple"
                 Grid.Column="1" /> 
WPF Grid,wpf grid control,wpf controls,wpf grid example,wpf example,wpf gridview,c# wpf grid,wpf samples,Grid.RowDefinitions, Grid.ColumnDefinitions and Grid.ColumnSpan
Wpf  Example 2 - Grid Rows and Columns Demo
I hope you will enjoy the development tips while programming with WPF in C#. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome. 

Also If you like this article, don't forget to share this article with your friends and colleagues.
C# - WPF Grid Example with ColumnSpan Reviewed by Ravi Kumar on 12:57 AM Rating: 5

No comments:

All Rights Reserved by Etechpulse © 2012 - 2017

Contact Form


Email *

Message *

Powered by Blogger.