Preventing users from changing Definition Query

306
2
04-17-2013 06:02 AM
ModyBuchbinder
Esri Regular Contributor
Hi all

I am using lyr files that include Definition Query to let the user add some part of existing layers to the map.
This is done mainly mosaic datasets that have some rasters that the user should not be able to see.
The problem is that smart user can just open layer properties and clear the Definition Query.
How can I prevent this?
Maybe class extension?, Change registry to drop this option from ArcMap? writing something in ArcMap extension?

Any ideas?
Thanks
Mody
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
I'm not aware of any ability to lock a layer internally to stop a user from editing the properties of a Layer.
0 Kudos
NeilClemmons
Regular Contributor III
I don't know that there is any way to prevent them from changing it but there is the IDefinitionExpressionEvents interface that has an event you can subscribe to that fires when the expression changes.  I imagine you could check the query and set it back.
0 Kudos