User (Old forums)MemberAugust 21, 2007 at 8:42 pmPost count: 23064
I am using Xceed Grid For .Net. I have a master grid which has a child detailgrid with a few columns.
The child detailgrid’s first column is set to use CheckBoxEditor / CheckBoxViewer, such that detailgrid rows can be selected/unselected using the checkbox. I want certain method to be called when the checkbox is checked/unchecked.
I am having tough time finding the correct event handler that gets initiated when checkbox value is changed on a detail row in a datagrid.
I tried using ‘ValueChanged’ but it doesn’t seem to work properly.
If you can help me with that will be great.
Imported from legacy forums. Posted by S (had 2421 views)User (Old forums)MemberAugust 22, 2007 at 3:32 pmPost 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.Columns[“chkDetailRow”].CellEditorManager.ActivatingControl += new CellEditorEventHandler(CellEditorManager_ActivatingControl);
parentRow.DetailGrids.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)Xceed SupportMemberAugust 23, 2007 at 12:35 pmPost count: 5658
You have 2 possibilities here:
1- You could use the “CurrentRow” item from the gridControl1. This reference also applies inside a Detail grid.
( ( Xceed.Grid.DataRow )gridControl1.CurrentRow ).Cells[ 2 ].BackColor = Color.Green;
2- You could use the “ParentRow” reference of the e.Cell inside your ActivatingControl event.
void CellEditorManager_ActivatingControl( object sender, CellEditorEventArgs e )
( ( Xceed.Grid.DataRow )e.Cell.ParentRow ).Cells[ 2 ].BackColor = Color.Green;
Imported from legacy forums. Posted by CharlesB (had 3415 views)
- You must be logged in to reply to this topic.