Home Forums WinForms controls Xceed Grid for WinForms Grid CheckBoxEditor Reply To: Grid CheckBoxEditor

User (Old forums)
Member
Post count: 23064

Although now I’m having a related problem.
I have a data bound grid. I’m doing the following;

private void gridEquipment_AddingDataRow(object sender, Xceed.Grid.AddingDataRowEventArgs e)
{

((Xceed.Grid.Editors.CheckBoxEditor)e.DataRow.Cells[“Returned”].CellEditorManager).ActivatingControl += new Xceed.Grid.Editors.CellEditorEventHandler(cb_ActivatingControl);
((Xceed.Grid.Editors.CheckBoxEditor)e.DataRow.Cells[“Returned”].CellEditorManager).DeactivatingControl += new Xceed.Grid.Editors.CellEditorEventHandler(cb_DeactivatingControl);

}

void cb_DeactivatingControl(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
{
((Xceed.Editors.WinCheckBox)e.Control).CheckedChanged -= new EventHandler(returned_CheckedChanged);
}

void cb_ActivatingControl(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
{
((Xceed.Editors.WinCheckBox)e.Control).CheckedChanged += new EventHandler(returned_CheckedChanged);
}

Which works great. Though the problem I’m having now is that when I change the bound data. Which is a custom row which inherits System.Data.DataRow the grid won’t automatically update. I’m having to manually change the check box like so;

((Xceed.Editors.WinCheckBox)(dr.Cells[“Returned”].CellEditorControl)).Checked = true;

Any ideas? The above is suitable as a work around, but I’d prefer not to do it.

Cheers.

Peter Henry.

Imported from legacy forums. Posted by Peter (had 612 views)