Assign the ID from the database to the Id property of the shapes, not to the UniqueId one.
Best Regards,Nevron Support Team