using System; 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 SimpleComplexBindingSourceDataBindingForm : Form { public SimpleComplexBindingSourceDataBindingForm() { InitializeComponent(); } private void SimpleComplexBindingSourceDataBindingForm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'northwindDataSet.Employees' table. You can move, or remove it, as needed. this.employeesTableAdapter.Fill(this.northwindDataSet.Employees); //RefreshItems(); } //private void moveFirstButton_Click(object sender, EventArgs e) { // this.employeesBindingSource.MoveFirst(); // RefreshItems(); //} //private void movePreviousButton_Click(object sender, EventArgs e) { // this.employeesBindingSource.MovePrevious(); // RefreshItems(); //} //private void moveNextButton_Click(object sender, EventArgs e) { // this.employeesBindingSource.MoveNext(); // RefreshItems(); //} //private void moveLastButton_Click(object sender, EventArgs e) { // this.employeesBindingSource.MoveLast(); // RefreshItems(); //} //private void RefreshItems() { // int count = this.employeesBindingSource.Count; // int position = this.employeesBindingSource.Position + 1; // // Update count and position text // this.countLabel.Text = count.ToString(); // this.positionLabel.Text = position.ToString(); // // Enable/Disable move buttons // this.moveFirstButton.Enabled = (position > 1); // this.movePreviousButton.Enabled = (position > 1); // this.moveNextButton.Enabled = (position < count); // this.moveLastButton.Enabled = (position < count); //} } }