O
Oka Morikawa
I have DataTable which I fill with DataAdapter.
Problem is that if I fill the DataTable with data in DB and after that I
insert new row it doesn't count Rows correctly.
private void InvoiceDetail_RowChanging(object sender,
DataRowChangeEventArgs e)
{
if (e.Action == DataRowAction.Add)
{
DataTable dt = (DataTable)sender;
int count = dt.Rows.Count;
dt.Columns["PacketNro"].DefaultValue = count;
}
}
If there is already 3 rows in DataTable in the new row "PacketNro" should be
4 but it's 0 and rows after that it counts correctly. The problem only
occurs in the first row only.
Thanks,
Oka Morikawa
Problem is that if I fill the DataTable with data in DB and after that I
insert new row it doesn't count Rows correctly.
private void InvoiceDetail_RowChanging(object sender,
DataRowChangeEventArgs e)
{
if (e.Action == DataRowAction.Add)
{
DataTable dt = (DataTable)sender;
int count = dt.Rows.Count;
dt.Columns["PacketNro"].DefaultValue = count;
}
}
If there is already 3 rows in DataTable in the new row "PacketNro" should be
4 but it's 0 and rows after that it counts correctly. The problem only
occurs in the first row only.
Thanks,
Oka Morikawa