laptop and a wrench

Bug

ISxDocument.UpdateContents does not update the contentsview correctly after switching the ContextItem in .NET.

Last Published: August 25, 2014 ArcGIS for Desktop
Bug ID Number NIM043981
SubmittedApril 6, 2009
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found9.3
Program languageVB.Net
Operating SystemWindows OS
Operating System VersionXP
Version Fixed10.1
StatusFixed

Workaround

Create VBA macro with working code in the SXD, something like this: Dim pSxDoc As ISxDocument Dim pSxTOC As ISxContentsView Set pSxDoc = Application.Document Set pSxTOC = pSxDoc.CurrentContentsView pSxTOC.Activate Application.hWnd, pSxDoc pSxTOC.ContextItem = pSxDoc.Scene.Layer(1) pSxDoc.UpdateContents pSxTOC.Refresh NothingThen use IVbaApplication.RunVBAMAcro in the VB.NET code to run that code: Dim pVbaApp As ESRI.ArcGIS.Framework.IVbaApplication Dim s As String pVbaApp = m_app pVbaApp.RunVBAMacro("Project", "ThisDocument", "TestTOC", Nothing)

Steps to Reproduce

Bug ID: NIM043981

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options