Visual WebGui Controls - ComboBox

Populating ComboBox
ComboBox1.DataBindings.Clear 'Very Important if you set the DataSource multiple times while using DataBindings
ComboBox1.DataSource = myBindingSource
ComboBox1.DisplayMember = "Name"
ComboBox1.ValueMember = "ID"

Populating ComboBox using EntityBridge
Notice how EntityField objects are used, not strings. Even Calculated EntityFields can be used.
'Supports EntityViews
DataPopulate(ComboBox1, myEntityView, EntityFields.Name, EntityFields.ID)

'Supports EntityCollections
DataPopulate(ComboBox1, myEntityCollection, EntityFields.Name, EntityFields.ID)

'Supports BindingSource
DataPopulate(ComboBox1, myBindingSource, EntityFields.Name, EntityFields.ID)

Last edited May 20, 2009 at 3:49 PM by rdhatch, version 4

Comments

No comments yet.