this.oGrid.DataSource = MyDataSet; this.oGrid.DataMember = "MyTable";Then you have to use the following syntax with TextBoxes:
this.txtLastName.DataBindings.Add("Text", MyDataSet, "MyTable.LastName")But if you bound your grid with:
this.oGrid.DataSource = MyDataSet.Tables["MyTable"];
Then you use this syntax for TextBoxes:this.txtLastName.DataBindings.Add("Text", MyDataSet.Tables["MyTable"], "LastName")Now, you *were* consistent in your databindings, so that's fine. However, because you used the first syntax, then the syntax for the BindingContext has to correspond. So, it would be this instead:
this.BindingContext[this.grdPolicyChangesNotes.DataSource, "PolicyNotes"].Position = dsPolicyNotes.Tables["PolicyNotes"].Rows.Count - 1;That should do the trick ... lemme know.
>private void btnNotes_Click(object sender, EventArgs e) > { > frmPolicyNotes frmNotes = new frmPolicyNotes(PolID); > frmNotes.Text = "Written Policy Notes"; > frmNotes.ShowDialog(); > > // Get update dataset with inserted record > //Policy Notes > dsPolicyNotes = oPolicyNotesBiz.GetNotes(PolID); > > grdPolicyChangesNotes.ReadOnly = true; > grdPolicyChangesNotes.DataSource = dsPolicyNotes; > grdPolicyChangesNotes.DataMember = "PolicyNotes"; > > //richtexbox just to display the notes ( field on my PolicyNotes table) > rtbPolicyChangesNotes.DataBindings.Clear(); >rtbPolicyChangesNotes.DataBindings.Add"Text",dsPolicyNotes, "PolicyNotes.Note"); > > // trying to implement bonnie suggestion > this.BindingContext[this.grdPolicyChangesNotes.DataSource].Position = dsPolicyNotes.Tables["PolicyNotes"].Rows.Count - 1; > count++; > > > > } >>