A possible solution, which I like because it does not involve programming and with very little work can be used in all the grids of your application, is to use CSS to display a text within the grid, when it does not have rows.
The solution is based on using the pseudo-class ": empty" on the HTML table that is generated for the grid, and some extensibility options that have the GeneXus themes.
If, for example, your grid has the class WorkWith
, you must include a Custom class in your theme with the name "WorkWith tbody:empty:after"
.
To add it, right click on the Custom node and select the "Add Class" option from the context menu.
Then, configure the properties of the new class in this way:
Display = block
Margin Top = 50px
Margin Bottom = 50px
Margin Left = 20px
Custom CSS Properties = content('<Aquí va el texto que quieres que aparezca>')
You can adjust the values of the margins or other aesthetic properties of the class to your liking, so that the message has the design you prefer.
This solution that I propose does not hide the head, so it will only serve you if it is acceptable for you to appear the head when there is no data. An alternative is to follow the steps proposed in another answer, in which they suggest hiding and showing controls depending on the number of records in the grid.