Validator Add Method (DataGridView, Label)CleanCode C# Libraries v1.2.03 API
Adds the specified OnlineDataGridView and its associated error label to the list of form fields to validate.

Namespace: CleanCode.Forms
Assembly: CleanCode (in CleanCode.dll) Version: (1.2.03)

public void Add(
	DataGridView dataGridView,
	Label errLabel

OnlineSystem NullReferenceException if an added Control does not have a Tag property defined.
OnlineSystem ArgumentException if a pattern attribute has an invalid regular expression.
OnlineSystem FormatException if any of the attributes that take numbers do not have a numerical argument.

Each added control must have a Tag property as described in the class description, otherwise a NullReferenceException will be thrown. Once all form controls to be validated are added with this method, then call ValidateAll  to validate all initial values, activate/deactivate error messages, and disable/enable the form's OK button. The OK button will only be enabled if all validated fields pass validation.
See Also