Click to See Complete Forum and Search --> : Can this be done?
Hinder
Jan 11th, 2003, 11:25 AM
Is it possible in vb.net to bind a control with a data source other than a database? I dought it's possible but I would like to be able to bind text boxes to variables :p
Edneeis
Jan 11th, 2003, 12:16 PM
You can bind to any object that implements IList or an interface that derives from IList. An example is the Arraylist which you can bind to.
Dim itms() As String = {"Edneeis", "Cander", "MartinLiss", "Serge"}
Dim al As New ArrayList(itms)
ComboBox1.DataSource = al
'if binding to a class you have to set the property to bind to
'ComboBox1.DisplayMember="MyProperty"
Hinder
Jan 11th, 2003, 12:19 PM
Ah very nice.. thanks Edneeis..
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.