Select to view content in your preferred language

Get the selected row from a table

703
2
Jump to solution
06-26-2023 12:59 AM
Daniel4
Emerging Contributor

I am trying to get the selected row from a table. 

I have created a TableControl objetc

private TableControl _tableControl = null;

 

And a method to fetch the selected row(s)

private async Task GetSelectedObjectIdsFromTable()
    {
        await QueuedTask.Run(() => _selectedObjectIds = _tableControl.GetSeletedObjectIds() as List<long>);
    }

 

The user can from a combobox select a layer from TOC and the content are showend in a tabel in a dockpane. But I can't figure out how I get the selected row from the table. 

Visual studio give me a waring to the above method, saying GetSelectedObjectIds are deprecated in 3.1. But what do i use insted?

Daniel4_0-1687766250455.png

 

 

0 Kudos
2 Solutions

Accepted Solutions
RichardDaniels
Frequent Contributor
Simplest is to realize that 'deprecated' just means it may not work in ArcGIS 3.2, which will not be out till 2025 or so.

View solution in original post

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I just now noticed that the method you were using has been misspelled in its original version.  The correct method name is: GetSelectedObjectIds 

The method you found as obsolete has the letter 'c' missing in Selected.  Apparently, the author of TableControl corrected the spelling and marked the originally misspelled variant as obsolete.  So you should be fine if you use the 'GetSelectedObjectIds ' variant.  Sorry about that.

View solution in original post

0 Kudos
2 Replies
RichardDaniels
Frequent Contributor
Simplest is to realize that 'deprecated' just means it may not work in ArcGIS 3.2, which will not be out till 2025 or so.
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I just now noticed that the method you were using has been misspelled in its original version.  The correct method name is: GetSelectedObjectIds 

The method you found as obsolete has the letter 'c' missing in Selected.  Apparently, the author of TableControl corrected the spelling and marked the originally misspelled variant as obsolete.  So you should be fine if you use the 'GetSelectedObjectIds ' variant.  Sorry about that.

0 Kudos