Select to view content in your preferred language

Attribute Window is not refreshed after programatically clearing selections.

816
2
02-26-2013 08:18 AM
SuiHuang
Frequent Contributor
Hi Everybody:

    I am using an event handler to automatically clear all the selections when a point in a specific layer is created. The clearing works for the attribute table of the layer and the selection on the map. However, the clearing doesn't work with the Attribute Window of the editor. This causes a strange state after the point is created: nothing is selected on the map (no blue highlight), but the Attribute Window tree view shows a newly created point feature.
    Why does this happen? How to synchronize the tree view in Attribute Window?
    Thank you!

// * this event handler is re-attached to the IEditEvents_Event.OnSelectionChanged of the ArcMap editor extension, every time
//    when a point of a specific layer is created.
// * This function is called when an edit session is started.
// * m_application is the IApplication of the ArcMap, and m_editor is the running editor extension
void Extension_OnSelectionChanged()
{
    (m_editor as IEditEvents_Event).OnSelectionChanged -= Extension_OnSelectionChanged
    ((m_application.Document as IMxDocument).FocusMap as IMap).ClearSelection();
    ((m_application.Document as IMxDocument).FocusMap as ISelectionEvents).SelectionChanged();
}
0 Kudos
2 Replies
LeoDonahue
Deactivated User
In Java, the Editor class has this:

contentsCleared(IActiveViewEventsContentsClearedEvent theEvent) 
          Fired when the contents of the view is cleared.

and this:

setAttributeEditAll(boolean pFlag) 
          Indicates if the pre-populate attributes dialog is used for all  layers or just the selected layers.

Does .NET have the equivalent methods?
0 Kudos
LeoDonahue
Deactivated User
What about "Invalidating the Display"?
0 Kudos