We are using Winforms Q3 2011. In our application, many of our dropdown lists are populated from lookup tables, so we have a generic method that maps to a lookup type, and we set the datasource to that:
Dim MyList as List(of AC.Lookup) = '... EF code
ddl.DataSource = MyList
Many of the lists are not required fields, so the proper default is to have nothing selected. When this is the case, however, the dropdown lists will have "AC.Lookup" displayed (where AC is the namespace for this EDMX file). After investigating, what appears to be happening is that the datasource doesn't quite know what to do with an empty list, so somehow it is calling the ToString.
This is confusing to the users. :-) I first looked for a "default text" or some other such property on the dropdown list, and when I couldn't find that, I tried to do various hacks, mainly around setting the text to nothing after some event (DataBinding, TextChanged, whatever). That method failed, too. What I ended up doing was creating a partial class tied to the Lookup class (the original Lookup class is generated from the designer, so I didn't want to change it), overriding ToString to return String.Empty. That worked and solved our problem, but it still seems very hackish.
Do you have a better, more elegant solution?
Thanks!