vijay rags

vijay rags

  • NA
  • 68
  • 163.4k

Re:How to validate multiple textboxes on lostfocus in silverlight

Sep 16 2011 9:36 AM
Hi,

  Please let me know how to validate mutiple textboxes in Silverlight3 on LostFocus event. I tried with  LostFocus event but the application gets hanged for tab changes.

private void txtFirstName_LostFocus(object sender, RoutedEventArgs e)
        {
            txtFirstName.ClearValidationError();

            if (string.IsNullOrEmpty(txtFirstName.Text))
            {
                txtFirstName.SetValidation("Please enter First Name");
                txtFirstName.RaiseValidationError();
                IsValid = false;
                txtFirstName.Focus();
            }
        }

Thanks in advance.




Answers (4)