private void btnProducerEdit_Click(object sender, EventArgs e) { //System.Diagnostics.Debugger.Break(); int i = grdProducers.CurrentRow.Index; DataRow row = dsProducers.Tables["Producers"].DefaultView[i].Row; // row contains the right info from the DataViewGrid!!! Producer frmProducers = new Producer(row); frmProducers.Text = "Producers"; frmProducers.ShowDialog(); }Here is the code for my Producer form :
public partial class Producer : Form { DataRow m_Row; public Producer(DataRow row) { //System.Diagnostics.Debugger.Break(); // The row contains the correct data !!!!!! m_Row = row; InitializeComponent(); } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } private void Producer_Load(object sender, EventArgs e) { System.Diagnostics.Debugger.Break(); this.txtFirstName.DataBindings.Add("Text", m_Row.Table, "FirstName"); this.txtLastName.DataBindings.Add("Text", m_Row.Table, "LastName"); this.txtLicenseNumber.DataBindings.Add("Text", m_Row.Table, "LicenseNumber"); this.txtAppointmentDate.DataBindings.Add("Text", m_Row.Table, "AppointmentDate"); this.chkActive.DataBindings.Add("Checked", m_Row.Table, "Active"); } private void btnOK_Click(object sender, EventArgs e) { m_Row.Table.AcceptChanges(); this.Close(); } }Why the producers form keep showing the first row on my DataGridView eventhough I pass it the correct row information???