[GIS] Automatically display related records for selected feature in tablewindow with ArcObjects

arcgis-10.0arcobjectscrelates

Is there a way through ArcObjects to automatically display the related table(s) for the selected feature in ArcMap in the attribute window (tablewindow) without the user having to click on it and select the related table. I can add a button that displays the tablewindow but I don't see how I can automatically display the related tables tab that appear in the window when the "related tables" button is clicked.

There is an ITableViewCallback interface that has a ShowRelationshipTable method to display related records. I can create a class that implements that interface but that doesn't seem to be what I want. I really just want to call the "ShowRelationshipTable" method of the tablewindow which doesn't seem to be exposed. I've also tried executing the command for "Related Tables" in the tablewindow which I think is:
esriGeoDatabaseUI.TableContextMenuRelationships but that doesn't do anything either. Is there a way with ArcObjects to automatically display the tabs for the related data without the user clicking on it?

Best Answer

Is there a way through ArcObjects to automatically display the related table(s) for the selected feature in ArcMap in the attribute window (tablewindow) without the user having to click on it and select the related table

This is definitely possible - I remember writing a script to do it years ago. In my case I generated a new standalone window and summarised the feature's info along with the related features' info.

Unfortunately I no longer have the code handy, but searching on ArcScripts shows another related script which might give some clues for how to traverse a relationship class programatically.

Hopefully this will give you some clues - sorry I can't be more directly helpful.

Related Question