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();
        }
Beispiel #2
0
        private void ProcessSelectAll(GridPanel panel, 
            GridContainer item, bool ckey)
        {
            if (item.Rows != null && item.Rows.Count > 0)
            {
                item.Expanded = true;

                foreach (GridContainer row in item.Rows)
                {
                    if (row is GridGroup)
                    {
                        ProcessSelectAll(panel, row, ckey);
                    }
                    else
                    {
                        int startIndex = ((GridContainer)item.Rows[0]).GridIndex;
                        int endIndex = ((GridContainer)item.Rows[item.Rows.Count - 1]).GridIndex;

                        if (ckey == true)
                        {
                            for (int i = startIndex; i <= endIndex; i++)
                                panel.SetSelectedRows(i, 1, !panel.IsRowSelected(i));
                        }
                        else
                        {
                            panel.SetSelectedRows(startIndex, endIndex - startIndex + 1, true);
                        }

                        break;
                    }
                }
            }
        }
Beispiel #3
0
        private void ProcessControlExtend(GridPanel panel, bool extend)
        {
            if (panel.LastProcessedItem == null)
                panel.LastProcessedItem = _MouseDownHitRow;

            GridContainer lastRow = panel.LastProcessedItem as GridContainer;

            if (lastRow != null)
            {
                int startIndex = lastRow.GridIndex;
                int endIndex = _HitItem.GridIndex;

                panel.NormalizeIndices(extend,
                    _AnchorIndex, ref startIndex, ref endIndex);

                for (int i = startIndex; i <= endIndex; i++)
                {
                    if (extend == false || i != _AnchorIndex)
                        panel.SetSelectedRows(i, 1, !panel.IsRowSelected(i));
                }

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