So basically I am trying to validate my drop down list (combobox) using the Validating event. This works, but calls the focus to my drop down list, not allowing a selection to be made.
Is there any way to get the errorProvider working with dropdownlist
if (ddlTypeOfPass.SelectedIndex < 1)
{
errorProvider1.SetError(ddlTypeOfPass, "Type of Pass is required");
e.Cancel = true;
return;
}
errorProvider1.SetError(ddlTypeOfPass, "");
}
I have figured this out, sorry my inital post may not have been helpful. I removed the e.Cancel to allow it to continue run, it sets focus, but does not force the user to stay on that control(which I kind of wanted) but this allows the user to actually set the drop down list.