Home Forums WinForms controls Xceed Grid for WinForms Checkbox value/state in DetailGrid Reply To: Checkbox value/state in DetailGrid

User (Old forums)
Member
Post count: 23064

btw..just to post some more info .. I got the check box checked/unchecked event handler to work.. by doing this ..while adding rows to Detail grid..

DataRow parentRow = gridControl1.DataRows[_key];
if(parentRow != null)
{
parentRow.DetailGrids[0].DataRows[0].Cells[“chkDetailRow”].CellEditorControl;
parentRow.DetailGrids[0].Columns[“chkDetailRow”].CellEditorManager.ActivatingControl += new CellEditorEventHandler(CellEditorManager_ActivatingControl);
parentRow.DetailGrids[0].Columns[“chkDetailRow”].CellEditorManager.DeactivatingControl += new CellEditorEventHandler(CellEditorManager_DeactivatingControl);
}

private void CellEditorManager_ActivatingControl(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
{
((Xceed.Editors.WinCheckBox)e.Control).CheckedChanged += new EventHandler(Form1_CheckedChanged);

}

private void CellEditorManager_DeactivatingControl(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
{

((Xceed.Editors.WinCheckBox)e.Control).CheckedChanged -= new EventHandler(Form1_CheckedChanged);

}

private void Form1_CheckedChanged(object sender, EventArgs e)
{
if (sender != null)
{
//some code here…
}
}

but the problem of changing the background color of a seperate column based on the state of checkbox (checked/unchecked) still remains.. I don’t know how to access the current row that is being checked and its columns…If I have to set current row’s 3rd column’s background to Green, how would I do that?
If anyone has any ideas please let me know..

Imported from legacy forums. Posted by S (had 347 views)