Hello I am trying to create a details
DataGrid
for a Master ID
However when I enter a new ID and try to edit the details
DataGrid
the new details record disappears from the
DataGrid
but is stored in the
DataTable
and I can see it when I reload the project.
XAML
I am using
CollectionViewSource
and they display the Master Detail scenario just fine but when it comes to updating.
Here I create a new record where the User inputs new ID and new Details for the ID
This works fine.
button click
{
CollectionViewSource vs = (CollectionViewSource)FindResource("CVSVouchers);
ObjectDataProvider odp = (ObjectDataProvider)FindResource("Vouchers");
DataView dv = (DataView)odp.Data;
dv.AddNew();
vs.View.MoveCurrentToLast();
}
and I handle the Datagrids Row EditEnding
Datagrid RowEditEnding
{
DataGridRow gridrow = e.Row;
DataRowView drv = gridrow.Item as DataRowView;
DataSet.ExpensesRow ExpRow = drv.Row as DataSet.ExpensesRow;
actExpRow.VoucherSN = float.Parse(this.txtID.Text);
}
then the record disappears from the
DataGrid
but is saved in the
DateTable
.