Beispiel #1
0
        private void ProcessSelect(GridPanel panel, bool ckey, bool skey)
        {
            int index = GridIndex;

            if (ckey == true)
                panel.SetSelectedRows(index, 1, !panel.IsRowSelected(index));
            else
                panel.SetSelectedRows(index, 1, true);

            panel.SetActiveRow(this, true); 

            if (skey == false && ckey == false)
                panel.InvalidateRender();
            else
                InvalidateRender();
        }
        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);
        }
Beispiel #3
0
        private void InvalidateRowRange(GridPanel panel, int start, int end)
        {
            Rectangle t = SuperGrid.ClientRectangle;

            GridContainer rs = panel.GetRowFromIndex(start);
            GridContainer re = panel.GetRowFromIndex(end);

            if (rs != null && re != null)
            {
                Rectangle rsRect = rs.Bounds;
                Rectangle reRect = re.Bounds;

                if (rs is GridPanel)
                    rsRect = GetScrollBounds(rs.ContainerBounds);

                if (re is GridPanel)
                    reRect = GetScrollBounds(re.ContainerBounds);

                Rectangle r = new Rectangle(rsRect.X, rsRect.Y,
                                            reRect.Width, reRect.Bottom - rsRect.Y);

                r.IntersectsWith(t);

                panel.InvalidateRender(r);
            }
        }