How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View

Overview

 
In this article, we will learn how we can easily create a header in the PowerApps Grid View. In my previous article, we created the Grid View with the help of Blank Gallery control in PowerApps.
 
There are different ways to create a header:
  1. You can use different controls like label or textbox and set them as a column header of the Grid.
  2. You can use the Data table to create a column header.
If you use the controls like textbox or labels, then it will take some more time in designing. The reason is we need to set the height, width, and formatting for each control.
 
We will use the easiest one which is to create a table header using the Data Table.
 
If you didn’t visit my previous articles, visit the article using the following URL.
So, now let’s get started!
 
Step 1
 
In my previous article, we have created the Grid something like the below screenshot.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
Create a Collection to store the name of Column Headers.
 
On the Screen’s OnVisible Action, write the below line of code.
  1. Collect(Header, {  
  2.     Title: "",  
  3.     Designation: "",  
  4.     Experience: "",  
  5.     InterviewDate: "",  
  6.     SelectionRound: ""  
  7. })   
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
The Collect function is creating the Collection named “Header” with the following columns.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
Step 2
 
Run your application and check whether your collection is created or not.
 
To check it, Go to View, and click on Collection.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
You can see, our collection named “Header” has been created with the blank data.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
Step 3
 
Click on the Insert menu, and add DataTable.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View 

Step 4
 
Add the data source in the created DataTable.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
Select “Header”.
 
Step 5
 
From “Fields” properties, select the required columns and arrange them by dragging and dropping.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 
Step 6
 
Set the Header width appropriate to the column names.
 
After arranging the fields, the DataTable will be set as a Header of the Grid column.
 
The final Grid Structure will look like the following screenshot.
 
How To Create A Header In PowerApps Blank Gallery - PowerApps Grid View
 

Conclusion

 
This is how we can easily create the Column Header in PowerApps Grid View. Stay connected with me for amazing Power Platform Articles like Power BI, PowerApps and MS Flow.
 
Don’t forget to follow me!!


Similar Articles