Can not select a ArcGIS Online layer using OpenItemDialog

163
3
03-27-2019 10:28 AM
FayuLai
New Contributor II

I was trying to select a layer from ArcGIS Online using the following code.  I can click the layer but pDialog.Items also return empty.  Any ideas?

var pDialog = new ArcGIS.Desktop.Catalog.OpenItemDialog();
pDialog.MultiSelect = false;
pDialog.Filter = "tables_all";
pDialog.ShowDialog();
var pItems = pDialog.Items;
if (pItems == null) return;

var pList = pItems.ToList<ArcGIS.Desktop.Core.Item>();
if (pList.Count < 1) return;

var pItem = pList[0];
if (pItem == null) return;

0 Kudos
3 Replies
FayuLai
New Contributor II

I still cannot get this to work.  Any help will be greatly appreciated.

0 Kudos
UmaHarano
Esri Regular Contributor

Hi Fayu

I am not able to reproduce this - When I select a layer from the OpenItemDialog (available from MyContent on ArcGIS Online) pDialog.Items is not empty.

Can you please provide some information on the content you are trying to access? It is a standalone table?

Thanks

Uma

0 Kudos
FayuLai
New Contributor II

Hi Uma,

Maybe it is to do with ArcGIS Pro version. It is not working in 2.2. But I tested in an ArcGIS 2.3 machine and it is working fine.

Thank you for your help!

Best regards,

Fayu

0 Kudos