I'm wondering if the DataLayoutControl supports or has a way to toggle required fields.
Say I have a data model as such
C#public enum CustomerType
{
User,
Reseller
}
public class DataModel
{
public string FirstName { get; set; }
public string LastName { get; set; }
public CustomerType CustomerType { get; set; } = CustomerType.User;
[Required(ErrorMessage = "Reseller name can not be null or empty.")] // need this to be conditional based on CustomerType.
public string ResellerName { get; set; }
}
If i can set this required field manually that will work as well.
Please let me know.