Assign Datagrid values to Datagrid instance

Hi,
I have made an instance of a Datagrid, but my code cannot recognize the properties in the Datagrid class. Picture is under

Screenshot 2021-11-22 at 09.58.55

I am using the following

I got it to work, dont know how