G
Grant Schenck
Hello,
I'm trying to programmatically add a row to a SQL bound (via binding source)
to a datagridview.
The code is as follows:
DataRowView drView =
(DataRowView)stationBindingSource.AddNew();
STPSRecorderDataSet.StationRow stationRow =
(STPSRecorderDataSet.StationRow)drView.Row;
stationRow.Extension = strExtensionToAdd;
It works fine and if I add more then one row they show up.
Now the problem is that if I move to a different record and then move back
the last row I added is removed. Also, if before selecting a different
record I manually select another row in the view, then, when I come back the
record does not disappear.
Does the code above look correct for adding a row to a bound DGV? Why does
the last row not "stick"?
I'm trying to programmatically add a row to a SQL bound (via binding source)
to a datagridview.
The code is as follows:
DataRowView drView =
(DataRowView)stationBindingSource.AddNew();
STPSRecorderDataSet.StationRow stationRow =
(STPSRecorderDataSet.StationRow)drView.Row;
stationRow.Extension = strExtensionToAdd;
It works fine and if I add more then one row they show up.
Now the problem is that if I move to a different record and then move back
the last row I added is removed. Also, if before selecting a different
record I manually select another row in the view, then, when I come back the
record does not disappear.
Does the code above look correct for adding a row to a bound DGV? Why does
the last row not "stick"?