using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace DataBindingFundamentalsSample { public partial class BindingSourceSimpleBindingForm : Form { public BindingSourceSimpleBindingForm() { InitializeComponent(); // Populate list data source with data items this.bindingSource.Add(new RaceCarDriver("M. Schumacher", 500)); this.bindingSource.Add(new RaceCarDriver("A. Senna", 1000)); this.bindingSource.Add(new RaceCarDriver("A. Prost", 400)); IList bsStorage = this.bindingSource.List; //// Simple bind the BindingSource's Name and Wins properties //// to the name and Wins text boxes. //this.nameTextBox.DataBindings.Add("Text", this.bindingSource, "Name"); //this.winsTextBox.DataBindings.Add("Text", this.bindingSource, "Wins"); } //private void moveFirstButton_Click(object sender, EventArgs e) { // this.bindingSource.MoveFirst(); //} //private void movePreviousButton_Click(object sender, EventArgs e) { // this.bindingSource.MovePrevious(); //} //private void moveNextButton_Click(object sender, EventArgs e) { // this.bindingSource.MoveNext(); //} //private void moveLastButton_Click(object sender, EventArgs e) { // this.bindingSource.MoveLast(); //} } }