We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid (DataSource?) Losing State

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; } } }

1 Reply

AD Administrator Syncfusion Team August 1, 2003 06:14 PM

Try calling Binder.BeginEdit and Binder.EndEdit to see if this takes care of the problem. gridLines.Binder.BeginEdit(); gridLines[i+1,1].Text = gridInvoice[row,col].Text; gridLines.Binder.EndEdit();

Loader.
Live Chat Icon For mobile
Up arrow icon