Contour code first and Conditional Logic 4
Another code first example, setting up field conditions when designing your form in visual studio.
There are 3 properties on the Field attribute that need to be used (EnableCondition, ConditionActionType and ConditionLogicType) then for setting up 1 or multiple rules you’ll need to decorate the property with a FieldConditionRule attribute providing it the caption of the field, the rule operator and the value.
[Field("Leave a comment", "Your comment",
Mandatory = true)]
public string Name { get; set; }
[Field("Leave a comment", "Your comment",
EnableCondition = true,
ConditionActionType = FieldConditionActionType.Show,
ConditionLogicType = FieldConditionLogicType.Any)]
[FieldConditionRule("Name",FieldConditionRuleOperator.Is, "Test")]
public string Hidden { get; set; }
In this case the field with caption hidden will only be shown if the value of the field with caption Name is test