ERLB binding source delete

ERLB binding source delete

Old forum URL: forums.lhotka.net/forums/t/6524.aspx


esteban404 posted on Friday, February 27, 2009

I have two grids in my application bound to ERLB objects using CSLA version 3.0.5. I've given them a context menu to delete a row from the grid. In one grid, they delete the row and its underlying data is deleted as expected.

On the other, however, it doesn't behave the same way. They are built exactly the same way except for their fields. Can anyone suggest where I may have gone wrong? Note the databinding does remove it from the displayed list. It just doesn't remove it from the underlying data store though it traces through OK.

I got it to work by doing this in the UI:
private void deleteRowToolStripMenuItem1_Click(object sender, EventArgs e)
{
this.defectBindingSource.RemoveAt(defectBindingSource.Position);
Qcpc item = (Qcpc)defectBindingSource.Current;
Qcpc.DeleteByID(item.DefectID); // added this method to get it to delete, shouldn't have had to do this
this.defectBindingSource.ResetBindings(false);
}

Thanks in advance,

_E

Copyright (c) Marimer LLC