Ejemplo n.º 1
0
        internal void ExtendSelection(
            GridPanel panel, GridContainer endItem, bool extend)
        {
            int startIndex = panel.SelectionRowAnchor.GridIndex;
            int endIndex = endItem.GridIndex;

            panel.NormalizeIndices(false, 0, ref startIndex, ref endIndex);

            if (panel.OnlyRowsSelected(startIndex, endIndex) == false)
            {
                if (extend == false)
                    panel.ClearAllSelected();
                else
                    panel.ClearAll(false);

                panel.SetSelectedRows(startIndex, endIndex - startIndex + 1, true);

                GridContainer row = GetLastProcessedRow(panel);

                if (extend == true && row != null)
                    startIndex = row.GridIndex;

                InvalidateRows(panel, startIndex, endIndex, extend);
            }
        }