public void UseValidation(IValidationCollection coll, string fieldName = null, string alternateLabel = null, string rowIndex = null) { VCollection = coll; if (VCollection == null) { VCollection = new ValidationCollection(Helper.GetFormName()); } string defName = InputModel.NgFormName + "__" + MemberName?.Replace(".", "_"); fieldName = (fieldName ?? defName) + (rowIndex == null ? "" : $"'+{rowIndex}+'"); VCollection.SetMember(ColumnId, fieldName, alternateLabel); ColumnModel.IsRequired = VCollection.HasRequired(); ColumnModel.ValidationMessages = GetCellErrors(VCollection); }
public void UseValidation(IValidationCollection coll, string fieldName = null, string alternateLabel = null) { VCollection = coll; if (VCollection == null) { VCollection = new ValidationCollection(Helper.GetFormName()); } VCollection.SetMember(ColumnId, fieldName ?? InputModel.FieldName, alternateLabel); GroupModel.IsRequired = VCollection.HasRequired(); if (GroupModel.IsRequired) { GroupModel.RequiredCondition = VCollection.GetRequiredCondition(); } GroupModel.ValidationMessages = VCollection.GetMessages(Helper); }