PeterWellington Posted March 10, 2006 Posted March 10, 2006 (Abridged code for example purposes) Class ABC Public Property XYZObject() As XYZ End Class Class XYZ Property SomeValue As String End Class --- I have a combo box where I'm setting the DataSource to an array of ABC objects. I'd like to use the SomeValue property of the XYZObject property of the ABC objects as the DisplayMember of the combo box. When I try to do this (combobox.DisplayMember = "XYZObject.SomeValue"), it doesn't recognize it as being a valid property (combo box instead shows ABC.ToString(), which happens according to the documentation when the property can't be resolved) Is what I'm trying to do possible or can I only reference properties that directly belong to ABC objects? Quote
Cags Posted March 10, 2006 Posted March 10, 2006 You cannot use a sub item as the DisplayMember, add another property to ABC that returns XYZObject.SomeProperty(), and use that as the DisplayMember, that should circumvent the problem. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.