OK. I want to delete rows from DataGrid. Im doing it like this:
So, row number Me.BindingContext(DataSet.Table1).Position is marked for deletion (it alsso disapears from DataGrid). The row is deleted, when I update DataSet from DataAdapter.
OK, It is all right through this point. But....
If I delete row nr. 8 (Me.BindingContext(DataSet.Table1).Position=8), then row nr. 9 gets number 8. And so on. I can not delete all rows using this method.
So my question is. How can I define real row number. ????
PS: Im deleteing selected row (in datagrid) by pressing a button.
Code:
Dim RowNumber as integer
RowNumber = Me.BindingContext(DataSet.Table1).Position
Me.DataSet.Table1.Rows(RowNumber).Delete
So, row number Me.BindingContext(DataSet.Table1).Position is marked for deletion (it alsso disapears from DataGrid). The row is deleted, when I update DataSet from DataAdapter.
OK, It is all right through this point. But....
If I delete row nr. 8 (Me.BindingContext(DataSet.Table1).Position=8), then row nr. 9 gets number 8. And so on. I can not delete all rows using this method.
So my question is. How can I define real row number. ????
PS: Im deleteing selected row (in datagrid) by pressing a button.