Home › WPF › WPF – Column and Row Definitions
WPF · Nov 7, 2015 · 1 MIN READ

WPF – Column and Row Definitions

In a WPF grid, we can define columns and rows. To do this, create a new WPF app in Visual Studio:

You will see below:

Select Layout in Properties. You will see Column Definitions and Row Definitions:

Select Column Definitions. Click Add:

Here you can add a column definition, which is defining a column, just as you would in a table for example:

Add a second column definition:

You will see in the XAML we have a ColumnDefinitions collection containing 2 ColumnDefinitions:

Let’s remove the column definition and add 3 row definitions. You will see:

If we use the Column and Row Definitions together, you can see we can build a grid that holds labels and textboxes for user input:

Looking at this, we have:

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.