'This line would refresh the selection pDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing) 'add this line to fully refresh the view pDoc.ActiveView.Refresh()
Ola,
Are you saying that when you toggle the layer's visibility off, you can still see the selected features?
If so, then it might be that you need to do a full refresh on the ActiveView:'This line would refresh the selection pDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing) 'add this line to fully refresh the view pDoc.ActiveView.Refresh()
The layer itself is set to visible, but I am trying to hide individual features within, based on some attribute values, and even hide them the from ArcMap's selection tool.
So you are invoking a DefinitionQuery on a featureLayer?
The default behavior seems to be that the selected feature should not show if included in the definition query filter. Perhaps it is something specific with your code that is producing the behavior you are seeing.
Post up the code you have so far.
I guess a queryfilter in the featurelayer would do the trick, but cannot find out how... The examples I find are related to the ArcIMS API, and I cant find similar methods here...
Could you give me a hint where to start?
Dim pFLayer As IFeatureLayer = pMap.Layer(0) Dim pDefQ As IFeatureLayerDefinition pDefQ = pFLayer pDefQ.DefinitionExpression = "OBJECTID = " & 11420 'I just set this for testing an Integer value 'altered to query a string field pDefQ.DefinitionExpression = "SomeStringField = '" & someStringValue & "'"
It would look something like this:Dim pFLayer As IFeatureLayer = pMap.Layer(0) Dim pDefQ As IFeatureLayerDefinition pDefQ = pFLayer pDefQ.DefinitionExpression = "OBJECTID = " & 11420 'I just set this for testing an Integer value 'altered to query a string field pDefQ.DefinitionExpression = "SomeStringField = '" & someStringValue & "'"
That's it, thanks a lot!
As often before, the solution is quite simple as long as you can find the right interfaces and examples. Which reminds me that the current help system, connected to the VisualStudio, usually answers everything I am NOT looking for...