Select to view content in your preferred language

Change display field/expression for the layer

10-03-2023 06:20 AM
New Contributor II



I am creating an in-memory database and then creating a layer and inserting data into it. Then that layer is being added to the active map.  Now I also need to change the display expression for that in-memory layer. For some layers it is a simple expression with combination of multiple field data but for some layers there is a custom logic which will generate a custom display field for the layers.

How can we change the display expression for the layers in this case?

@Wolf @GKmieliauskas @CharlesMacleod 

Tags (1)
0 Kudos
2 Replies
Esri Regular Contributor


Look at the ArcPro SDK community QueryBuilderControl sample.

          // update mapMember definition query
          QueuedTask.Run(() =>
            if (fLayer != null)
0 Kudos
by Esri Regular Contributor
Esri Regular Contributor

Instead of creating the data on the fly for your memory GDB feature classes, you could have additional fields that hold the result of your custom logic.  This way you can code your custom logic in .Net and use the custom field for display or filtering.   Otherwise, you have to use different definition queries (and Map layers) for each 'custom logic' variant (as mentioned above by @GKmieliauskas )

0 Kudos