Adding a new row

  • Thread starter Thread starter Mel Weaver
  • Start date Start date
M

Mel Weaver

Hi,
I'm using a typed dataset and adding a new row to dataview.

DataRowView newDRV = catView.AddNew();
newDRV["CName"] = acf.categoryTextBox.Text;
newDRV.EndEdit();

The row is added. My problem is I need to dataview to be positioned on the
new row. I have tried using the currencymanager and setting the position
without luck. Any help will be appreciated.

Mel
 
What do you mean with "dataview to be positioned on the new row"?

DataView is a DataTable filter, if you want a DataView with only one row and
you have an id in your table, you can set in the RowFilter the id you are
looking for.

DataRowView newDRV=catView.AddNew();
....

catView.RowFilter="id="+newDRV["id"];
 
Back
Top