Gerard,
Yeah, it's a bit confusing at times, isn't it? <s>
The NewRow() method doesn't actually add the new row to the DataSet. Here's how you have to do it:
DataRow row = this.ds.Tables["MYTABLE"].NewRow();
row["MyFirstColumn"] = "whatever";
this.ds.Tables["MYTABLE"].Rows.Add(row);
Also, since you said that you need to "go" to that row, you'll need to update the BindingContext Position, like this:
int recno = this.ds.Tables["MYTABLE"].Rows.Count - 1;
this.BindingContext[this.ds.Tables["MYTABLE"]].Position = recno;
That should do it!
~~Bonnie
>Hi.
>I have a form with two pages, Grid in page one and Controls in Page 2
>I have a Dataset displaying fine in page one, with controls in Page Two.
>
>I have an 'Add' button , the purpose of which is to 'Add' a new record
>I have following code in click event:
>this.ds.Tables["MYTABLE"].NewRow();
>
>This seems to run (.i.e does not give an error message) but I cannot see a new record in the Grid ?
>
>What I would like to do is:
>1. Add the new record to the Dataset Table
>2. 'Land' on this record (i.e. Goto MyNewDatSetRecord)
>3. Set focus to the first field on Page 2
>
>Any assistance greatly appeciated
>
>Regards
>Gerard