///<summary>
        /// GridVirtualRowList
        ///</summary>
        ///<param name="container"></param>
        public GridVirtualRows(GridContainer container)
        {
            _Container = container;

            _PageBuckets = new VPageBucket[MaxBuckets];
            _PageBuckets[0] = new VPageBucket(_Container, 0);
        }
예제 #2
0
 ///<summary>
 /// GridRowHeaderClickEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="row"></param>
 ///<param name="e"></param>
 public GridRowHeaderClickEventArgs(
     GridPanel gridPanel, GridContainer row, MouseEventArgs e)
     : base(gridPanel, row)
 {
     _MouseEventArgs = e;
 }
            public VPageBucket(GridContainer container, int startIndex)
            {
                _Container = container;
                _StartIndex = startIndex;
                _EndIndex = startIndex + MaxRows - 1;

                _Rows = new GridRow[MaxRows];
            }
예제 #4
0
        private void GetSelectedCells(GridContainer container, SelectedElementCollection items)
        {
            foreach (GridElement item in container.Rows)
            {
                if (item.Visible == true)
                {
                    GridContainer citem = item as GridContainer;

                    if (citem != null)
                    {
                        GridPanel panel = citem as GridPanel;

                        if (panel != null)
                        {
                            if (panel.VirtualMode == false)
                                panel.GetSelectedCells(items);
                        }

                        if (citem.Rows.Count > 0)
                            GetSelectedCells(citem, items);
                    }
                }
            }
        }
예제 #5
0
        /// <summary>
        /// Handles invocation of RowsPurging events
        /// </summary>
        internal bool DoRowsPurgingEvent(GridContainer row)
        {
            if (RowsPurging != null)
            {
                GridRowCancelEventArgs ev = new
                    GridRowCancelEventArgs(row.GridPanel, row);

                RowsPurging(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
예제 #6
0
        /// <summary>
        /// Handles invocation of RowMoving events
        /// </summary>
        internal bool DoRowMovingEvent(GridRow gridRow,
            GridContainer srcCont, int srcIndex, ref GridContainer destCont, ref int destIndex)
        {
            if (RowMoving != null)
            {
                GridRowMovingEventArgs ev = new GridRowMovingEventArgs(
                    gridRow.GridPanel, gridRow, srcCont, srcIndex, destCont, destIndex);

                RowMoving(this, ev);

                destIndex = ev.DestIndex;
                destCont = ev.DestContainer;

                return (ev.Cancel);
            }

            return (false);
        }
예제 #7
0
        /// <summary>
        /// Handles invocation of RowHeaderClick events
        /// </summary>
        internal void DoRowHeaderClickEvent(
            GridPanel gridPanel, GridContainer row, MouseEventArgs e)
        {
            if (RowHeaderClick != null)
            {
                GridRowHeaderClickEventArgs ev =
                    new GridRowHeaderClickEventArgs(gridPanel, row, e);

                RowHeaderClick(this, ev);
            }
        }
예제 #8
0
        /// <summary>
        /// Handles invocation of RowActivated events
        /// </summary>
        internal void DoRowActivatedEvent(
            GridPanel gridPanel, GridContainer oldRow, GridContainer newRow)
        {
            if (RowActivated != null)
            {
                GridRowActivatedEventArgs ev = new
                    GridRowActivatedEventArgs(gridPanel, oldRow, newRow);

                RowActivated(this, ev);
            }
        }
예제 #9
0
        private GridContainer GetNextRow(GridContainer lrow)
        {
            GridContainer row = lrow.NextVisibleRow;

            while (row != null)
            {
                if (row.AllowSelection == true)
                    return (row);

                row = row.NextVisibleRow;
            }

            return (null);
        }
예제 #10
0
        private GridCell GetNextRowCell(GridContainer item, int index)
        {
            while (item != null)
            {
                GridRow row = item as GridRow;

                if (row != null)
                {
                    if (row.AllowSelection == true)
                    {
                        GridCell cell = row.GetCell(index,
                            row.GridPanel.AllowEmptyCellSelection);

                        if (cell != null)
                        {
                            if (cell.AllowSelection == true)
                                return (cell);
                        }
                    }
                }

                item = item.NextVisibleRow;
            }

            return (null);
        }
예제 #11
0
        private void OnActiveRowChanged(
            GridContainer oldValue, GridContainer newValue)
        {
            GridPanel panel =
                (oldValue != null) ? oldValue.GridPanel :
                (newValue != null) ? newValue.GridPanel : null;

            DoRowActivatedEvent(panel, oldValue, newValue);
        }
예제 #12
0
        ///<summary>
        /// GridRowMovingEventArgs
        ///</summary>
        ///<param name="gridPanel"></param>
        ///<param name="gridRow"></param>
        ///<param name="srcCont"></param>
        ///<param name="srcIndex"></param>
        ///<param name="destCont"></param>
        ///<param name="destIndex"></param>
        public GridRowMovingEventArgs(GridPanel gridPanel, GridRow gridRow,
            GridContainer srcCont, int srcIndex, GridContainer destCont, int destIndex)
            : base(gridPanel, gridRow)
        {
            _SrcIndex = srcIndex;
            _SrcContainer = srcCont;

            _DestIndex = destIndex;
            _DestContainer = destCont;
        }
예제 #13
0
 ///<summary>
 /// GridRowMovedEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="gridContainer"></param>
 ///<param name="gridRow"></param>
 public GridRowMovedEventArgs(GridPanel gridPanel,
     GridContainer gridContainer, GridContainer gridRow)
     : base(gridPanel, gridRow)
 {
     _GridContainer = gridContainer;
 }
예제 #14
0
 ///<summary>
 /// GridRowMouseEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="gridRow"></param>
 ///<param name="ev"></param>
 ///<param name="rowArea"></param>
 public GridRowMouseEventArgs(GridPanel gridPanel, GridContainer gridRow, MouseEventArgs ev, RowArea rowArea)
     : base(ev.Button, ev.Clicks, ev.X, ev.Y, ev.Delta)
 {
     _GridPanel = gridPanel;
     _GridRow = gridRow;
     _RowArea = rowArea;
 }
예제 #15
0
 ///<summary>
 /// GridRowHeaderDoubleClickEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="row"></param>
 ///<param name="e"></param>
 public GridRowHeaderDoubleClickEventArgs(
     GridPanel gridPanel, GridContainer row, MouseEventArgs e)
     : base(gridPanel, row, e)
 {
 }
예제 #16
0
        /// <summary>
        /// Handles invocation of PostRenderPanelRow events
        /// </summary>
        internal void DoPostRenderPanelRowEvent(
            Graphics g, GridContainer gridRow, RenderParts parts, Rectangle bounds)
        {
            if (PostRenderPanelRow != null)
            {
                GridPostRenderRowEventArgs ev = new
                    GridPostRenderRowEventArgs(g, gridRow.GridPanel, gridRow, parts, bounds);

                PostRenderPanelRow(this, ev);
            }
        }
예제 #17
0
        /// <summary>
        /// Handles invocation of PreRenderPanelRow events
        /// </summary>
        internal bool DoPreRenderPanelRowEvent(
            Graphics g, GridContainer gridRow, RenderParts parts, Rectangle bounds)
        {
            if (PreRenderPanelRow != null)
            {
                GridPreRenderRowEventArgs ev = new
                    GridPreRenderRowEventArgs(g, gridRow.GridPanel, gridRow, parts, bounds);

                PreRenderPanelRow(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
예제 #18
0
        internal bool KeySelectRow(GridPanel panel,
            GridContainer row, bool select, bool extend)
        {
            if (row != null)
            {
                int rowIndex = row.RowIndex;

                if (row.CanSetActiveRow(false) == true)
                {
                    if (panel.SetActiveRow(row, true) == true)
                    {
                        if (select == true && extend == false)
                            panel.SelectionRowAnchor = row;
                    }

                    if (select == true)
                    {
                        if (rowIndex != row.RowIndex)
                            ArrangeGrid();

                        row.ExtendSelection(panel, row, extend);

                        panel.InvalidateRender();
                    }
                    else
                    {
                        if (ActiveElement != null)
                            ActiveElement.InvalidateRender();

                        row.InvalidateRender();
                    }

                    panel.LastProcessedItem = row;

                    row.EnsureVisible();
                }

                return (true);
            }

            return (false);
        }
예제 #19
0
        /// <summary>
        /// Handles invocation of RowActivating events
        /// </summary>
        internal bool DoRowActivatingEvent(
            GridPanel panel, GridContainer orow, GridContainer nrow)
        {
            if (RowActivating != null)
            {
                GridRowActivatingEventArgs ev = new
                    GridRowActivatingEventArgs(panel, orow, nrow);

                RowActivating(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
예제 #20
0
        private void KeyCtrlSelectRow(GridContainer row)
        {
            if (row != null)
            {
                ActiveElement = row;

                row.IsSelected = !row.IsSelected;

                row.EnsureVisible();
            }
        }
예제 #21
0
        /// <summary>
        /// Handles invocation of RowHeaderDoubleClick events
        /// </summary>
        internal bool DoRowHeaderDoubleClickEvent(GridContainer row, MouseEventArgs e)
        {
            if (RowHeaderDoubleClick != null)
            {
                GridRowHeaderDoubleClickEventArgs ev = new
                    GridRowHeaderDoubleClickEventArgs(row.GridPanel, row, e);

                RowHeaderDoubleClick(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
예제 #22
0
        /// <summary>
        /// Handles invocation of AfterCollapse events
        /// </summary>
        internal void DoAfterCollapseEvent(GridPanel gridPanel, GridContainer gridContainer, ExpandSource expandSource)
        {
            if (AfterCollapse != null)
            {
                GridAfterCollapseEventArgs ev = new
                    GridAfterCollapseEventArgs(gridPanel, gridContainer, expandSource);

                AfterCollapse(this, ev);
            }
        }
예제 #23
0
        /// <summary>
        /// Handles invocation of RowResized events
        /// </summary>
        internal void DoRowResizedEvent(GridPanel gridPanel, GridContainer gridRow)
        {
            if (RowResized != null)
            {
                GridRowEventArgs ev = new
                    GridRowEventArgs(gridPanel, gridRow);

                RowResized(this, ev);
            }
        }
예제 #24
0
        /// <summary>
        /// Handles invocation of AfterExpand events
        /// </summary>
        internal void DoAfterExpandEvent(
            GridPanel gridPanel, GridContainer container, ExpandSource expandSource)
        {
            if (AfterExpand != null)
            {
                GridAfterExpandEventArgs ev = new
                    GridAfterExpandEventArgs(gridPanel, container, expandSource);

                AfterExpand(this, ev);
            }
        }
예제 #25
0
        /// <summary>
        /// Handles invocation of RowsPurged events
        /// </summary>
        internal void DoRowsPurgedEvent(GridContainer row)
        {
            if (RowsPurged != null)
            {
                GridRowEventArgs ev = new GridRowEventArgs(row.GridPanel, row);

                RowsPurged(this, ev);
            }
        }
예제 #26
0
        /// <summary>
        /// Handles invocation of BeforeExpand events
        /// </summary>
        internal bool DoBeforeExpandEvent(
            GridPanel gridPanel, GridContainer container, ExpandSource expandSource)
        {
            if (BeforeExpand != null)
            {
                GridBeforeExpandEventArgs ev = new
                    GridBeforeExpandEventArgs(gridPanel, container, expandSource);

                BeforeExpand(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
예제 #27
0
        /// <summary>
        /// Handles invocation of GetRowStyle events
        /// </summary>
        internal void DoGetRowStyleEvent(
            GridContainer gridRow, StyleType eStyle, ref RowVisualStyle style)
        {
            if (GetRowStyle != null)
            {
                GridGetRowStyleEventArgs ev = new
                    GridGetRowStyleEventArgs(gridRow.GridPanel, gridRow, eStyle, style);

                GetRowStyle(this, ev);

                style = ev.Style;
            }
        }
예제 #28
0
        /// <summary>
        /// Handles invocation of GetRowHeaderText events
        /// </summary>
        internal void DoGetRowHeaderTextEvent(GridContainer row, ref string text)
        {
            if (GetRowHeaderText != null)
            {
                GridGetRowHeaderTextEventArgs ev = new
                    GridGetRowHeaderTextEventArgs(row.GridPanel, row, text);

                GetRowHeaderText(this, ev);

                text = ev.Text;
            }
        }
            public void Reset(GridContainer container, int startIndex)
            {
                for (int i = 0; i < MaxRows; i++)
                {
                    GridRow row = _Rows[i];

                    if (row != null)
                    {
                        row.Dispose();

                        _Rows[i] = null;
                    }
                }

                _Container = container;
                _StartIndex = startIndex;
                _EndIndex = startIndex + MaxRows - 1;
            }
예제 #30
0
 ///<summary>
 /// GridRowEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="gridRow"></param>
 public GridRowEventArgs(GridPanel gridPanel, GridContainer gridRow)
     : base(gridPanel)
 {
     _GridRow = gridRow;
 }