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.
Unfortunately, activation email could not send to your email. Please try again.

Grid (DataSource?) Losing State

Thread ID:





6143 Aug 1,2003 01:24 PM Aug 1,2003 06:14 PM Windows Forms 1
Tags: GridControl
scot adams
Asked On August 1, 2003 01:24 PM

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

Administrator [Syncfusion]
Replied On 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();


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.