It’s because you can only access to that attribute inside the dataview, so you cannot make the dataview visible or not with the attribute that you set in the entity.
What you can do is to add a container inside the dataview (with all his content), and make that container visible or not.
Thanks Yehoshoua.. It worked.. I was adding the container outside of dataview. Now i added inside and its working.
Maybe mark Yehoshua’s answer as correct? ;-)