// 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();
Solved! Go to Solution.
Hi thaviti:
I tried with the firing the event, but the Attribute Window still doesn't update. Do I need to implement event handler for "SelectionChanged"?
Thank you!
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); (mapLayer as IFeatureSelection).SelectionChanged(); // 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!
Fire SelectionChanged after changing the selectionset.
Hi thaviti:
I tried with the firing the event, but the Attribute Window still doesn't update. Do I need to implement event handler for "SelectionChanged"?
Thank you!