AnsweredAssumed Answered

How to update the attribute window after programatically select a feature?

Question asked by huangs3 on Jul 4, 2012
Latest reply on Jul 5, 2012 by huangs3
Hi Everybody:

    I am writing code to programatically create new features, select features on the map, and keep the attribute window open to display the new feature in an edit session. However, even though I could select the feature and get it highlighted on the map, the attribute window does not display the new selected feature properly. Following is the code I used to select the feature:

// This section of code is repeatly run to clear previously created feature and select newly created feature                        // select the new feature     (mapLayer as IFeatureSelection).Clear();     (mapLayer as IFeatureSelection).SelectionSet.Add(newFeature.OID);      // open the attribute window     UID attributeWinId = new UIDClass();     attributeWinId.Value = "esriEditor.AttributeWindow";     IAttributeWindow attributeWin = m_editor.FindExtension(attributeWinId) as IAttributeWindow;     attributeWin.Visible = true;                          // refresh the view     (m_Application.Document as IMxDocument).ActiveView.Refresh();


For the first time this section of code is executed in an ArcMap edit session, the attribute window is opened (originally closed) and it displays the newly selected feature, but for the second time this code runs the displayed feature in attribute window wouldn't be updated automatically. How to synchonize it with the actual selection? Thank you!

Outcomes