Display member in listbox using mysqldatatable as datasource

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
oleengvoll
Posts: 12
Joined: Tue 27 Sep 2011 08:37

Display member in listbox using mysqldatatable as datasource

Post by oleengvoll » Tue 15 May 2012 11:34

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

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Display member in listbox using mysqldatatable as dataso

Post by Pinturiccio » Thu 17 May 2012 13:43

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.

oleengvoll
Posts: 12
Joined: Tue 27 Sep 2011 08:37

Re: Display member in listbox using mysqldatatable as dataso

Post by oleengvoll » Fri 18 May 2012 11:26

Hi! OK, thanx. I'll try this solution! /Ole

Post Reply