CSLA .NET 2.0
I can't get the ErrorProvider to flash when I have a null value in a bound ComboBox. It works just fine with TextBoxes that are bound to validated properties. Anyone have any ideas?
loBinding = new Binding("SelectedValue", moCMRequest, "TypeID");cmbType.DataBindings.Add(loBinding);
TypeID is a Nullable<Guid> property of my business object.
protected override void AddBusinessRules()
{
ValidationRules.AddRule(TypeIDNotNull, "TypeID");
}
private bool TypeIDNotNull(object target, Csla.Validation.RuleArgs e)
{
if (mgTypeID == null)
return false;
else
return true;
}
I wasn't setting e.Description. My Bad!!
SelectedValueChanged does not fire when the combobox is cleared. You need to bind to SelectedTextChanged as well.
Jim
Copyright (c) Marimer LLC