Change the Display Name Attribute based on the user selection

Hello,

How do I change the Display Name for a property? I have a drop-down list for the user to select. Based on the user selection, I enable certain properties and also want to change the Display Name before enabling it.

Thanks!

Hi priram,
You can’t necessarily change the Display name of the property, but you can use the HideIfDisabled property on the EnabledIf Attribute to show/hide specific properties based on your drop-down selection.

An example of EnabledIf: sdk/Examples/PluginDevelopment/TestSteps/Attributes/EnabledIfAttributeExample.cs · master · OpenTAP / OpenTAP · GitLab

This won’t change the Display name of the same property, but it will make it look like the display name has changed on the UI.
image
image
image

Hope this helps!

4 Likes