Display member in listbox using mysqldatatable as datasource
-
- Posts: 12
- Joined: Tue 27 Sep 2011 08:37
Display member in listbox using mysqldatatable as datasource
Hi! We are using a listbox with a mySqlDataTable as datasource. How can we make custom columns displaying several data field (combined) to be shown in "DisplayMember" in the listbox? Now we can only choose one field that exists in the mySqlDataTable columns. Thanx. Ole
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Display member in listbox using mysqldatatable as dataso
According to MSDN http://msdn.microsoft.com/en-us/library ... ember.aspx The ListBox DisplayMember property can set a String specifying the name of an object property that is contained in the collection specified by the DataSource property. So you can assign one of the columns as a DisplayMember property value, but you cannot assign a combination of columns, as the MySqlDataTable object has no property corresponding to the combination.
If you want to display several columns, try using the DataGridView component instead of ListBox.
If you want to display several columns, try using the DataGridView component instead of ListBox.
-
- Posts: 12
- Joined: Tue 27 Sep 2011 08:37
Re: Display member in listbox using mysqldatatable as dataso
Hi! OK, thanx. I'll try this solution! /Ole