J
jez
I tried the following code, without success :
***
DataRow rowToDelete;
rowToDelete = productsTable.NewRow();
rowToDelete["customerID"] = listBoxCustomers.SelectedValue;
rowToDelete["productID"] =
dataGridProducts[dataGridProducts.CurrentCell.RowNumber,dataGridProducts.Cur
rentCell.ColumnNumber].ToString();
rowToDelete["product"] =
dataGridProducts[dataGridProducts.CurrentCell.RowNumber,(dataGridProducts.Cu
rrentCell.ColumnNumber)+1].ToString();
rowToDelete.Delete();
productsTable.AcceptChanges();
***
I don't get an error though.. I just want to delete the current row that is
selected in a DataGrid.
Am I doing anything wrong ? Is there another way that I could use to delete
rows ?
I tried to do a Rows.Find(PrimaryKeyValues)
but without success - I get an error saying I don't have any primary keys in
the table - even though I do. They're specified in a .xsd schema.
thanks, jez
***
DataRow rowToDelete;
rowToDelete = productsTable.NewRow();
rowToDelete["customerID"] = listBoxCustomers.SelectedValue;
rowToDelete["productID"] =
dataGridProducts[dataGridProducts.CurrentCell.RowNumber,dataGridProducts.Cur
rentCell.ColumnNumber].ToString();
rowToDelete["product"] =
dataGridProducts[dataGridProducts.CurrentCell.RowNumber,(dataGridProducts.Cu
rrentCell.ColumnNumber)+1].ToString();
rowToDelete.Delete();
productsTable.AcceptChanges();
***
I don't get an error though.. I just want to delete the current row that is
selected in a DataGrid.
Am I doing anything wrong ? Is there another way that I could use to delete
rows ?
I tried to do a Rows.Find(PrimaryKeyValues)
but without success - I get an error saying I don't have any primary keys in
the table - even though I do. They're specified in a .xsd schema.
thanks, jez