DevExpress inherited ComboEdit crashes in Descriptor.SetValue


Author
Message
George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search