Change DataGrid Visibility based on data availability

Hello. I would like to know whether it is possible to show/hide some columns of a DataGrid if there are no data in it (show when there is data and hide when there is no data).
2 answers

Well data grid shows list of records for an entity.

If it is not mandatory for a column to be filled when the object is created, then it means, the value may exist or can be empty for each and every record.

How do you want to decide for each record the column to be shown or not? 

Although, your functional requirement is not clear, simple answer is, it is not possible to show or hide columns. 


Thank you for you reply. I understand your concerns about the data being different for each row. However, the entity being used is non-persistent and the data is being populated from a HTTP request. As such, there are some columns that would be always empty for a particular response from the server. For example, for a particular request, columns 1,2,3 might contain data while 4 and 5 remain empty for all rows while another request populates data in columns 1,5 and 2,3 and 4 remain empty.