Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to update the Editor Attributes dialog to populate/refresh on ArcObject feature selection code? The attributes dialog only seems to respond to a manual view selection or manual table selection. Here is my current feature selection code:


            Dim pFeatSelection As IFeatureSelection = Nothing
            Dim pFeatureLayer As IFeatureLayer
            Dim pQueryFilter As IQueryFilter
            Dim pSelSet As ISelectionSet
            Dim pFCur As IFeatureCursor = Nothing
            Dim player As ILayer
            Dim pEnumLayer As IEnumLayer

            m_App = CType(Hook, IApplication)
            m_MxDoc = CType(m_App.Document, IMxDocument)
            m_mxDocument = CType(m_App.Document, MxDocument)
            m_map = CType(m_MxDoc.FocusMap, Map)

            Dim pActiveView As IActiveView
            pActiveView = m_MxDoc.FocusMap

            m_map = m_MxDoc.ActiveView.FocusMap
            pEnumLayer = m_map.Layers

            Dim number As Int32 = InputBox("FID number")

            player = pEnumLayer.Next
            Do Until player Is Nothing
                If player.Name = "MyLayer" Then
                    pFeatureLayer = CType(player, IFeatureLayer)
                    pFeatSelection = CType(pFeatureLayer, IFeatureSelection)
                End If
                player = pEnumLayer.Next

            pQueryFilter = New QueryFilter
            pQueryFilter.WhereClause = "FID = " & number

            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)

            pFeatSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultNew, False)
            ' Create a feature cursor of selected interstates.
            pSelSet = pFeatSelection.SelectionSet
            pSelSet.Search(Nothing, False, pFCur)
            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)

        Catch ex As Exception
            MessageBox.Show("Caught an unspecified error in the calling code: " & vbCrLf & ex.ToString)
share|improve this question
up vote 3 down vote accepted

Make sure you call IFeatureSelection.SelectionChanged on every layer you update the selection of.

Also, while not needed in every case, once the layer selection is updated for all desired layers, you should cast the Map to ISelectionEvents and call ISelectionEvents.SelectionChanged as well.

share|improve this answer
That was it, thank you! – artwork21 Dec 16 '11 at 1:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.