Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

ArcMap retains fields of removed Table.

$
0
0
All,

I have developed an AddIn for ArcMap 10.1 using VB .net 2010.

My tool writes data it creates to a dBase file which gets loaded into the TOC. During processing the tool can create up to 25 fields.

Sometimes a user will need to rebuild this table with its initial set of 3 fields (by selecting a button on toolbar).

When the user clicks on the create table button my code searches for the table in the TOC and removes it with the following code:

Code:

pStandAloneTableCollection.RemoveStandaloneTable(pStandAloneTable)
pMXDocument.UpdateContents()

The code then continues by deleting the existing dBase file and then recreates with the default set of 3 fields. This all works fine. The table is loaded back into the TOC with the following code:

Code:

pStandAloneTable = New StandaloneTableClass
pStandAloneTable.Table = pTable
pStandAloneTable.Name = Me.TextBox1.Text
pStandAloneTableCollection.AddStandaloneTable(pStandAloneTable)
pMXDocument.UpdateContents()

If I then go to the Table in ArcMap and open it I see all the previous fields (with zero values) and not an attribute table with just 3 fields. It's as if ArcMap has held onto the schema of the table it had removed, any ideas on how to force a refresh?

Duncan

Viewing all articles
Browse latest Browse all 1374

Trending Articles