Select to view content in your preferred language

List symbology layers in dropdown list within combobox on ribbon

279
0
10-29-2024 09:04 AM
RileyAnderson
New Contributor

I'm working through the ArcGIS Pro SDK Community Samples on the Esri github. I already have configured a custom tab on the ribbon using the RibbonControls example. There is a combobox on the ribbon with a dropdown list. What I want to do is add display layers to the list so users can quickly change the display of the map. Some layers will be rendered multiple times to show different attributes, e.g. the Streets layer will be shown in the list twice for different symbology options ("Streets with Population", "Streets with Community Name"). This is the combobox currently on my ribbon, with the default code from RibbonControls:

RileyAnderson_0-1730217406363.png

 

ComboBoxShowingLayers is close to what I want because it's a combobox with a layer list but it doesn't include CIM rendering and it lists all the layers in the active map. CIMExamples has the CIMRendererfromScratch or CIMRendererWithDefinition button which seems to be my solution for creating symbology layers that can be rendered on the fly, except that the UI for this is a button rather than a dropdown list.  I feel like it should be simple to add the code from CIMRendererWithDefinition or CIMRendererfromScratch into the ComboBox1.cs that I already have configured on the ribbon rather than as a button but I can't figure out where to place the code or what to change. Thanks in advance.

0 Kudos
0 Replies