Select to view content in your preferred language

Getting the Selected Layer in the TOC

613
1
Jump to solution
06-14-2022 11:29 AM
BrianBulla
Honored Contributor

Hi,

I'm trying to get the name/names of all the layers in the TOC that the user may have selected.  Can anyone point me to an SDK sample or some code of how to do this??

Thanks,

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Have you tried this:

var layers = MapView.Active.GetSelectedLayers();

View solution in original post

1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

Have you tried this:

var layers = MapView.Active.GetSelectedLayers();