I have an Invoice grid, and an Invoice Line grid that are linked with a parent/child relationship. The datatables that fill the grids, both have a bool column, so each grid has a checkbox in the first row. On the mouse up event, I fire the method below. This method checks the status of the checkbox in the Invoice (parent) table, and sets the checkboxes in the Line (child) grid to the same value. All the values check as expected, but when I click on a differnt row in the Invoice (parent) grid, and then back to one of the rows that I clicked the checkbox, the correspoding Lines will have a checkbox that is no longer checked (and vice versa with when unchecking). It usually occurs with the last checkbox in the child grid, and is inconsistant.
private void gridInvoices_MouseUp(object sender, MouseEventArgs e)
{
GridCurrentCell cc = gridInvoices.CurrentCell;
int row = cc.RowIndex;
int col = cc.ColIndex;
if(col == 1)
{
for(int i = 0; i < gridLines.Model.RowCount;i++)
{
gridLines[i+1,1].Text = gridInvoice[row,col].Text;
}
}
}