Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5778

ETO ListBox with DataStore and custom items (list of )

$
0
0

@clement wrote:

Hi @curtisw, @dale,

i am creating a Eto.Forms.ListBox which uses a DataStore for its list items as shown here. However my list is not a list of strings but a list of class instances. The class name is “Fruit”. The listbox DataStore seems to accept my list but each list item is displayed in the listbox like this:

<__main__.Fruit instance at 0x0000000000000085>

Each class instance has a property “Name”. How do i tell Eto to use “Name” as Eto.Forms.ListItem.Text ?

In Windows forms this is done like this:

self._listBox1.DataSource = MyListOfFruit
self._listBox1.DisplayMember = "Name"

_
c.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5778

Trending Articles