T
Tomer
How can I delete the row that the datagrid is showing?
Its not enought to use:
DS.Tables["thetable"].Rows[DG.CurrentRowIndex].Delete();
Because this way I can loose the right record position, for example if I have three records and I first delete the first record, then the CurrentRowIndex will not be corresponding with the table record number.
For now I use this line:
DS.Tables["thetable"].Rows.Find((object)KeyFieldLabel.Text).Delete();
KeyFieldLabel is binded to the tables' primary key.
But I need a better and simpler way to do this.
Thanks.
Tomer.
Its not enought to use:
DS.Tables["thetable"].Rows[DG.CurrentRowIndex].Delete();
Because this way I can loose the right record position, for example if I have three records and I first delete the first record, then the CurrentRowIndex will not be corresponding with the table record number.
For now I use this line:
DS.Tables["thetable"].Rows.Find((object)KeyFieldLabel.Text).Delete();
KeyFieldLabel is binded to the tables' primary key.
But I need a better and simpler way to do this.
Thanks.
Tomer.