I have a DX grid view and it has 2 bool columns. My purpose is when I check for ex 2nd row in column1, column2 2nd must be changed immediatly, but not. It changes after clicking another row. Here is my rowcellvaluechanged event code :
void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
//button1.PerformClick();
if (e.Column.Name == "col1")
{
var x = gridView1.GetRowCellValue(e.RowHandler, col1);
gridView1.SetRowCellValue(e.RowHandler, col2, x);
}
}
I looked for in DX website and there is no solution. How can I handle on it ?
You can use the GridView.PostEditor method to immediately pass the changed value from the editor into the Grid's underlying data source. The best place for doing this is the EditValueChanged event of real cell editor. You can handle this event as follows:
Then you can implement all needed dependencies:
The Grid posts an editor value when you switch to another cell. To force it, call the PostEditor method. But, in this case, you will need to use the EditValueChanged event of the active editor. To get it, use the ActiveEditor property. To catch the moment, when an editor is created, use the ShownEditor event.