Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3305
finding position from a header row?
posted

I have a grid where I have a checkbox in the first cell of the header control and I need to be able to track position from the checked/unchecked event handler from the check box control so I can check all /uncheck all child rows per level.

Unfortunately I cannot access a parent row or child rows form the header row.

this is the code I've tried and it does not work

 try
            {
                CheckBox box = sender as CheckBox;
                HeaderCellControl cell = (box).Parent as HeaderCellControl;
                HeaderRow r = cell.Cell.Row as HeaderRow;
 
                bool valtoPass = (bool)box.IsChecked;
                Row activeRow = (Row)grdOLAPObjects.ActiveCell.Row;
                if (activeRow.ParentRow != null)
                {
                    try
                    {
                        OlapObjectInformation selectedCatalog = activeRow.ParentRow.Data as OlapObjectInformation;
                        selectedCatalog.Cubes.ForEach(p => p.Active = valtoPass);
                    }
                    catch
                    { }
                }
            }picture of grid

sl grid