Пример #1
0
        public virtual void RemoveEditor(IInputEditor editor)
        {
            GridViewEditManager gridViewEditManager = (GridViewEditManager)null;

            if (this.GridViewElement != null)
            {
                gridViewEditManager = this.GridViewElement.EditorManager;
            }
            if (gridViewEditManager == null || editor != null && !gridViewEditManager.IsPermanentEditor(editor.GetType()))
            {
                RadItem editorElement = this.GetEditorElement(editor);
                if (editorElement != null && this.Children.Contains((RadElement)editorElement))
                {
                    this.Children.Remove((RadElement)editorElement);
                }
                this.editor = (IInputEditor)null;
                this.SetContent();
            }
            int num = (int)this.SetValue(GridDataCellElement.IsInEditModeProperty, (object)false);
        }
Пример #2
0
        public override bool OnMouseDown(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && this.OnMouseDownLeft(e) || e.Button == MouseButtons.Right && this.OnMouseDownRight(e) || base.OnMouseDown(e))
            {
                return(true);
            }
            this.scrollBarAtPoint = GridVisualElement.GetElementAtPoint <RadScrollBarElement>((RadElementTree)this.GridViewElement.ElementTree, e.Location);
            if (this.scrollBarAtPoint != null && this.scrollBarAtPoint.Parent is GridTableElement)
            {
                GridViewEditManager editorManager = this.GridControl.EditorManager;
                bool whenValidationFails          = editorManager.CloseEditorWhenValidationFails;
                editorManager.CloseEditorWhenValidationFails = true;
                editorManager.CloseEditor();
                editorManager.CloseEditorWhenValidationFails = whenValidationFails;
                return(false);
            }
            IGridBehavior rowBehaviorAtPoint = this.GetRowBehaviorAtPoint(e.Location);

            return(rowBehaviorAtPoint != null && rowBehaviorAtPoint.OnMouseDown(e));
        }
Пример #3
0
        public virtual void AddEditor(IInputEditor editor)
        {
            GridViewEditManager editorManager = this.GridViewElement.EditorManager;

            if (editor != null && this.editor != editor && !editorManager.IsPermanentEditor(editor.GetType()))
            {
                this.editor = editor;
                RadItem editorElement = this.GetEditorElement(this.editor);
                if (editorElement != null && !this.Children.Contains((RadElement)editorElement))
                {
                    int num = (int)editorElement.SetDefaultValueOverride(VisualElement.ForeColorProperty, (object)Color.FromKnownColor(KnownColor.ControlText));
                    this.Children.Add((RadElement)editorElement);
                    BaseGridEditor baseGridEditor = editor as BaseGridEditor;
                    if (baseGridEditor != null && baseGridEditor.ClearCellText)
                    {
                        this.Text = string.Empty;
                    }
                }
            }
            int num1 = (int)this.SetValue(GridDataCellElement.IsInEditModeProperty, (object)true);
        }