This method receives a DataBindingItem parameter which includes a reference to both the control and the DataSource object where you can check values. Return false from the event method to indicate that validation failed which causes a new BindingError to be created and added to the BindingErrors collection.
public event delItemResultNotification ValidateControl
protected bool DataBinder_ValidateControl(Westwind.Web.Controls.DataBindingItem Item) { if (Item.ControlInstance == txtCategoryId) { DropDownList List = Item.ControlInstance as DropDownList; if (List.SelectedItem.Text == "Dairy Products") { Item.BindingErrorMessage = "Dairy Properties not allowed (ValidateControl)"; return false; } } return true; }