Hi. I'm trying to binding a field in a datatable to a combobox. Another table in the dataset is providing the Valuemembers and displaymembers. This field can contain nulls so I'm adding a row with a dbnull and "" into the start of the table where the Valuemembers and displaymembers are. However, when I attempt to bind to the 'SelectedValue' property I get an error:
This only happens if I bind to a field that is null. If I open the form and the field is not null then it works fine. Also, in this case, if I try to change this field to the null row in the combobox then I can't leave the combobox.
I'm sure I'm missing something obvious but I've been looking at this for two days and it hasn't exactly jumped out at me:-( so any help would be greatly appreciated.
Thanks in advance,
Durkin
Code:
Specified argument was out of the range of valid values.
Parameter name: '-2147483554' is not a valid value for 'index'.
This only happens if I bind to a field that is null. If I open the form and the field is not null then it works fine. Also, in this case, if I try to change this field to the null row in the combobox then I can't leave the combobox.
I'm sure I'm missing something obvious but I've been looking at this for two days and it hasn't exactly jumped out at me:-( so any help would be greatly appreciated.
Thanks in advance,
Durkin