Databinding
-
Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name. The code:
MyListBox.DataSource = MyObject MyListBox.ValueMember = "ID" //Property of MyObject MyListBox.DisplayMember = "SubObject.Name" //Property of SubObject
-
Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name. The code:
MyListBox.DataSource = MyObject MyListBox.ValueMember = "ID" //Property of MyObject MyListBox.DisplayMember = "SubObject.Name" //Property of SubObject
DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this. Anil Joshi
-
DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this. Anil Joshi
This has nothing to do with SQL. The data is coming from a Xml-File. But that is not the point. What MyListBox.ValueMember = "ID" does is bind it with a Property in the already bound MyObject. So the question remains is it possible to use a property of a property as a DisplayMember? /Johan