I am using the DevExpress inherited ComboBoxEdit. I populate the object with a BO (detail), and I set the BusinessObject and BindingFiled properties to my master BO and the foreign key property respectivelly. The property that is the foreign key (and thus the Value of the combo) is of type Guid.
Everything works fine, the combo is populated, I can select from the list etc.
If by editing I clear the text of the combo, as if a wanted no value for the field (which is perfectly leagal in my case),
then I get an InvalidCastException inside the descriptor of the property at:
public override void SetValue(Object component, object Value)
{
((CustomerBO)component).RefererID = (System.Guid)Value;
}
The Value object on the right of the assignment is DBNull, and this is why the cast fails. How can I overcome this?
Thanks
This thing is giving me a bit of a hard time