WPF – Column and Row Definitions

Leave a comment

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:

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

See more articles on: WPF

Leave a Reply

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