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:
- You can use different controls like label or textbox and set them as a column header of the Grid.
- 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.
Create a Collection to store the name of Column Headers.
On the Screen’s OnVisible Action, write the below line of code.
- Collect(Header, {
- Title: "",
- Designation: "",
- Experience: "",
- InterviewDate: "",
- SelectionRound: ""
- })
The Collect function is creating the Collection named “Header” with the following columns.
Step 2
Run your application and check whether your collection is created or not.
To check it, Go to View, and click on Collection.
You can see, our collection named “Header” has been created with the blank data.
Step 3
Click on the Insert menu, and add DataTable.
Step 4
Add the data source in the created DataTable.
Select “Header”.
Step 5
From “Fields” properties, select the required columns and arrange them by dragging and dropping.
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.
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!!