RowState not changing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a DataGrid with edit and delete buttons bound to a record set. I have
added code to remove records from the record set and re-bind to the data grid
when then delete button is clicked. This works fine. I use GetChanges to get
the records for writing to the database and it comes up null.

What does it take to make the RowState change? Any help?
 
NCZIMM said:
I have a DataGrid with edit and delete buttons bound to a record set. I
have
added code to remove records from the record set and re-bind to the data
grid
when then delete button is clicked. This works fine. I use GetChanges to
get
the records for writing to the database and it comes up null.

You shouldn't be removing records from the DataSet. Rather, you should use
Delete. That will set the RowState to Deleted.

John Saunders
 
Hi John,

John Saunders said:
You shouldn't be removing records from the DataSet. Rather, you should use
Delete. That will set the RowState to Deleted.

Note that if the RowState is Added and you do a Delete on the row it will be
removed from DataTable.
 
Miha Markic said:
Hi John,



Note that if the RowState is Added and you do a Delete on the row it will
be removed from DataTable.

That makes good sense - it undoes what had been done before (as the record
would not previously have been written to the database).

John
 
Back
Top