I've fixed it...in a mildly unpleasant way...

I created my own custom drop down...well to be honest I reused the
existing one and then fixed the problem in an override....which is
unpleasant.

Bottom line is that it's the "GetFormattedValue" method on the
DataGridViewComboBoxCell class that throws an exception...

So if you override that and replace it with

            if (value != null)
            {
                object formattedValue = value.GetType().GetProperty
(this.DisplayMember).GetValue(value, null);

                return formattedValue;
            }
            else
            {
                return "";
            }

Then it (for the moment), works.

Not nice...and setting up the custom control is a bit of a pain...but
seeems to work now...though saying that, I haven't really tested it, so
expect another post in a minute saying it's all broken.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to