Exemplo n.º 1
0
        private static bool GetFocusable(GridCell gridCell)
        {
            if (gridCell.IsKeyboardFocused)
            {
                return(true);
            }

            if (gridCell.ContainsKeyboardFocus())
            {
                return(false);
            }

            var dataPresenter = gridCell.DataPresenter;

            if (dataPresenter != null)
            {
                var p = dataPresenter.GetService <Presenter>(false);
                if (p != null && p.Mode == GridCellMode.Edit)   // DataView is in Edit mode
                {
                    return(gridCell.IsEditable);
                }
            }

            return(true);
        }
Exemplo n.º 2
0
            public void ToggleMode(GridCell gridCell)
            {
                VerifyGridCell(gridCell, nameof(gridCell));

                bool isKeyboardFocusWithin = gridCell.IsKeyboardFocusWithin;
                var  mode = Mode;

                Mode = mode == GridCellMode.Edit ? GridCellMode.Select : GridCellMode.Edit;
                gridCell.Refresh();
                if (isKeyboardFocusWithin && !gridCell.ContainsKeyboardFocus())
                {
                    gridCell.Focus();
                }
            }