Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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:

Try

            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
            Loop

            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)
        Finally

Thank You

share|improve this question
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.