I have two combobox and two textboxes and a button
i am disabling the button on the load and enables only after selections are made
i need to do validation for these
i am able to do the validation for textboxes, in Validating event,(using single event for both)
i am trying to do the validation for the combobox , so that button is enabled only after the selection is made. i am doing it in Validating event(using single event for both)
but if i do so the event is fired on the first combobox and is not validating the second combobox.
privatevoid cmbData_Validating(object sender, CancelEventArgs e)
{
ComboBox cmbSelect = (ComboBox)sender;if (cmbSelect.SelectedItem == null){
nameError.SetError(cmbSelect,
"Please select a value");lblError.Visible =
true;lblError.Text =
"Please select a value";cmbSelect.Focus();cmbSelect.Tag =
false;}
else{
nameError.SetError(cmbSelect,
"");lblError.Visible =
false;cmbSelect.Tag =
true;}
ValidateAll();
}
i would like to know how to write the validation for this.
would be kind if any one could help me in this