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"];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top