I have a table with a foreign key which is set via a RadComboBox control on an Edit Form Template. All works well if a value is picked from the combo box, but it is possible for this field to be null. To allow this, I have set up an item in the combo which has "unknown" as its text and a blank value property. The lookup values via a datasource are appended to this in the standard manner.
However, despite Linq defining this field as being nullable, unless I pick a value from the combo box the RadGrid won't save it. Unbinding the combo box (thus effectively ignoring the field) is fine - the new row is added without fuss, so the field can be null, it's just that a blank value field in the RadComboBox obviously doesn't equate to this at save time.
So my question is, what's the best way to handle lookups for foreign key fields where the foreign key can be null? (I should add that the foreign key field is an Int32, in case that matters).
Thanks,
Peter
However, despite Linq defining this field as being nullable, unless I pick a value from the combo box the RadGrid won't save it. Unbinding the combo box (thus effectively ignoring the field) is fine - the new row is added without fuss, so the field can be null, it's just that a blank value field in the RadComboBox obviously doesn't equate to this at save time.
So my question is, what's the best way to handle lookups for foreign key fields where the foreign key can be null? (I should add that the foreign key field is an Int32, in case that matters).
Thanks,
Peter