Home All Groups Group Topic Archive Search About

combobox displays [Namespace].[ClassName]

Author
3 Feb 2006 7:55 PM
Matt
Here is my code:

lstEditEventTypes.DisplayMember = "Name.Value"
lstEditEventTypes.ValueMember = "ID"
lstEditEventTypes.DataSource = m_EventTypes

m_EventTypes is a collection.

This worked fine until I changed the Name to a propertyholder.  So, to
access the name value, I have to use Name.Value.  But now my combobox just
displays:

[MyNamespace].[MyClassName]

Thanks.

Matt

Author
3 Feb 2006 8:04 PM
Jon
Put the following in your class

Public Overrides Function ToString() As String

Return VariableToDisplayAsComboboxText

End Function




Show quoteHide quote
"Matt" <matt.arens@nospamremovethis-gmail.com> wrote in message
news:%23m10HvPKGHA.744@TK2MSFTNGP09.phx.gbl...
> Here is my code:
>
> lstEditEventTypes.DisplayMember = "Name.Value"
> lstEditEventTypes.ValueMember = "ID"
> lstEditEventTypes.DataSource = m_EventTypes
>
> m_EventTypes is a collection.
>
> This worked fine until I changed the Name to a propertyholder.  So, to
> access the name value, I have to use Name.Value.  But now my combobox just
> displays:
>
> [MyNamespace].[MyClassName]
>
> Thanks.
>
> Matt
>