public static bool ValidateForm(this XtraForm frm)
        {
            dXErrorProvider.ClearErrors();

            foreach (Control c in frm.Controls.Cast <Control>().Where(x => x.Tag != null).OrderBy(x => x.TabIndex))
            {
                if (c is BaseEdit ctrl)
                {
                    if (!string.IsNullOrEmpty(ctrl.Tag?.ToString()))
                    {
                        if (ctrl.EditValue == null)
                        {
                            dXErrorProvider.SetError(ctrl, ctrl.Tag?.ToString());
                            dXErrorProvider.SetIconAlignment(ctrl, ErrorIconAlignment.MiddleRight);
                            ctrl.Focus();
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="errorProvider"></param>
 /// <param name="control"></param>
 public static void SetColorDefaultTextControl(DXErrorProvider errorProvider, BaseEdit control)
 {
     errorProvider.ClearErrors();
     control.Properties.Appearance.BorderColor = Color.LightGray;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="errorProvider"></param>
 /// <param name="control"></param>
 public static void SetColorDefaultTextControl(DXErrorProvider errorProvider, BaseEdit control)
 {
     errorProvider.ClearErrors();
     control.Properties.Appearance.BorderColor = Color.LightGray;
 }