Hi,
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?
Hi,
Look at the ArcPro SDK community QueryBuilderControl sample.
// update mapMember definition query
QueuedTask.Run(() =>
{
if (fLayer != null)
fLayer.SetDefinitionQuery(newExpression);
});
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 )