System.Windows.Forms.ListControl.DataSource Property

Gets or sets the data source for this System.Windows.Forms.ListControl.


public object DataSource { set; get; }


Documentation for this section has not yet been entered.


There are two ways to fill the System.Windows.Forms.ComboBox and System.Windows.Forms.ListBox controls.

For example, you can add objects to the System.Windows.Forms.ComboBox by using the System.Windows.Forms.ComboBox.ObjectCollection.Add(object) method. You can also add objects to a System.Windows.Forms.ComboBox by using the ListControl.DataSource, ListControl.DisplayMember, and ListControl.ValueMember properties to fill the System.Windows.Forms.ComboBox.

When the ListControl.DataSource property is set, a user cannot modify the items collection.

If setting the ListControl.DataSource property causes the data source to change, the ListControl.DataSourceChanged event is raised. If setting this property causes the data member to change, the ListControl.DisplayMemberChanged event is raised.

When you set ListControl.DataSource to null, ListControl.DisplayMember is set to an empty string ("").


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0,