DevExpress inherited ComboEdit crashes in Descriptor.SetValue


Author
Message
George Nentidis
George Nentidis
StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 reputation)StrataFrame User (168 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

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I understand....what I was trying to say in my previous post is that something within the DevExpress is trying to set the field to DbNull...not empty.  And since that field is not setup to support a Null value, you get the exception.  I would first investigate why the DevExpress field is trying to set the bound field to DbNull...that is where your error is coming from.
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