TableControl GetSeletedObjectIds

588
3
Jump to solution
10-02-2019 10:01 PM
VictorTey
Esri Contributor

Hi, can anyone advise on what is the the proper way to call GetSeletedObjectIds on TableControl. Following the guide on the link below, I have attempted to run GetSeletedObjectIds on both TableControlDockpaneViewModel and TableControlDockpaneView in QueueTask.run. Both resulted in throwing an exception

""The calling thread cannot access this object because a different thread owns it"

ProGuide TableControl · Esri/arcgis-pro-sdk Wiki · GitHub 

if (_addToMapCommand == null)
                {
                    _addToMapCommand = new RelayCommand(() =>
                    {
            
                        QueuedTask.Run(() =>
                        {
                            try
                            {
                                var test = _tableControl.GetSeletedObjectIds().ToString();
                            }catch(Exception e)
                            {
                                return;
                            }
                            return;
                        });

                    });
                }

Thanks

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Hi Victor Tey

Unfortunately, this is still not available in 2.4 version of ArcGIS Pro SDK.

For more information refer to the link below:

ProGuide TableControl · Esri/arcgis-pro-sdk Wiki · GitHub 

View solution in original post

0 Kudos
3 Replies
MehdiPira1
Esri Contributor

Hi Victor Tey

Unfortunately, this is still not available in 2.4 version of ArcGIS Pro SDK.

For more information refer to the link below:

ProGuide TableControl · Esri/arcgis-pro-sdk Wiki · GitHub 

0 Kudos
NarelleChedzey
Esri Contributor

Actually the exceptions on GetAllObjectIDs, GetSelectedObjectIDs, GetSelectedRowIndexes and Select methods should have been fixed in ArcGIS Pro 2.3.2.    These methods should also work correctly in ArcGIS Pro 2.4

If you are using ArcGIS Pro 2.3, please upgrade to the latest service pack.  It is currently Pro 2.3.3 I believe. 

If you are still seeing these errors using Pro 2.3.2 or above please post and so that we can investigate further. 

Regards

Narelle 

VictorTey
Esri Contributor

Hi Narelle Chedzey‌, you are right as well. I tested it on 2.4.2 and it is working.

Thanks

0 Kudos