Esempio n. 1
0
        internal bool KeySelectCell(
            GridPanel panel, GridCell cell, bool select, bool extend)
        {
            if (cell != null)
            {
                int rowIndex = cell.GridRow.RowIndex;

                if (cell.CanSetActiveCell(panel, cell) == true)
                {
                    if (select == true && extend == false)
                    {
                        panel.SelectionRowAnchor = cell.GridRow;
                        panel.SelectionColumnAnchor = cell.GridColumn;
                    }

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

                        cell.ExtendSelection(panel, cell, extend);

                        if (cell.CellEditMode == CellEditMode.Modal)
                        {
                            if (panel.KeyboardEditMode == KeyboardEditMode.EditOnEntry)
                                cell.BeginEdit(true);
                        }
                    }
                    else
                    {
                        if (ActiveElement != null)
                            ActiveElement.InvalidateRender();

                        cell.InvalidateRender();
                    }

                    panel.LastProcessedItem = cell;

                    cell.EnsureVisible();

                    return (true);
                }
            }

            return (false);
        }