public IReadOnlyList<StandaloneTable> GetStandaloneTablesAsFlattenedList()
Public Function GetStandaloneTablesAsFlattenedList() As IReadOnlyList(Of StandaloneTable)
Return Value
A IReadOnlyList of StandaloneTables
public IReadOnlyList<StandaloneTable> GetStandaloneTablesAsFlattenedList()
Public Function GetStandaloneTablesAsFlattenedList() As IReadOnlyList(Of StandaloneTable)
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { var map = ArcGIS.Desktop.Mapping.MapView.Active.Map; if (map == null) return; //Get a particular table template var tableTemplate = map.FindStandaloneTables("Address Points").FirstOrDefault()?.GetTemplate("Residences"); //Get all the templates of a standalone table var ownersTableTemplates = map.FindStandaloneTables("Owners").FirstOrDefault()?.GetTemplates(); var statisticsTableTemplates = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().First(l => l.Name.Equals("Trading Statistics")).GetTemplates(); });
var table = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().FirstOrDefault(); if (table == null) return; QueuedTask.Run(() => { var tableTemplate = table.GetTemplate("Template1"); //Removing a table template table.RemoveTemplate(tableTemplate); //Removing a template by name table.RemoveTemplate("Template2"); });
var container = MapView.Active.Map; //the map standalone table collection var table = container.GetStandaloneTablesAsFlattenedList() .FirstOrDefault(tbl => tbl.Name == "EarthquakeDamage"); //or from a group layer var grp_layer = MapView.Active.Map.FindLayers("GroupLayer1").First() as GroupLayer; var table2 = grp_layer.FindStandaloneTables("EarthquakeDamage").First(); //or grp_layer.GetStandaloneTablesAsFlattenedList().First() //or grp_layer.StandaloneTables.Where(...).First(), etc. //show the table in a table view //use FrameworkApplication.Current.Dispatcher.BeginInvoke if not on the UI thread FrameworkApplication.Panes.OpenTablePane(table2);
//get the first group layer that has at least one table var grp_layer = MapView.Active.Map.GetLayersAsFlattenedList() .OfType<GroupLayer>().First(g => g.StandaloneTables.Count > 0); var map = MapView.Active.Map;//assumes non-null QueuedTask.Run(() => { //get the tables from the map container var tables = map.GetStandaloneTablesAsFlattenedList(); //delete the first... if (tables.Count() > 0) { map.RemoveStandaloneTable(tables.First()); //or delete all of them map.RemoveStandaloneTables(tables); } //delete a table from a group layer //assumes it has at least one table... grp_layer.RemoveStandaloneTable(grp_layer.StandaloneTables.First()); });
Target Platforms: Windows 11, Windows 10