I use EF and set DataSource of bindingSource as User.
now in listBox I would Like to set valueMember asUserId
and DisplayMember as Product.ProductName (nested property)
schemat is:
User _________ UserId UserName ProductId Product _________ ProductId ProductName
I WOuld like to bind a lot of Users to that control and display ProductNames but now there is visible only one ProductName even though there are for example 4 users.
The classes generated by EF are partial, so you can create another source file and add a property to your User class, like that:
this way you would not need to access nested properties for DisplayMember.