示例#1
0
        // update position of child grids when column widths/etc change
        //
        // when rows are added, removed, or resized, move child grids so they
        // stay in their proper position.
        //
        override protected void OnGridChanged(object sender, GridChangedEventArgs e)
        {
            // always call base implementation
            base.OnGridChanged(sender, e);

            // reset data if child column became invalid
            if (_colChild != null && !Cols.Contains(_colChild))
            {
                ResetChildren();
            }

            // update positions after adding/removing/resizing rows/columns
            if (e.GridChangedType == GridChangedTypeEnum.GridChanged ||
                e.GridChangedType == GridChangedTypeEnum.RowAdded ||
                e.GridChangedType == GridChangedTypeEnum.RowRemoved)
            {
                UpdateChildren();
            }
        }