Hi Mohd,
That’s because you’re trying to get a non-peristable entity from the database. A non-presistent Entity lives in Memory and is never stored in the DB, hence you’ll be getting this error.
To solve this, you either change your entity to a persistent entity and make sure it is committed to the database, or you associate the data with a parent object that you pass as context to your page and then fetch the rows of data over association through the datagrid. This last option does support non-persistent entities that are not stored in the database.
We need to use Association to use non-Persistent entity in data grid.