Exemple #1
0
 internal static void UpdateMenuTheme(GridVisualElement gridElement, RadDropDownMenu menu)
 {
   if (menu == null)
     return;
   string str = gridElement.ElementTree.ThemeName;
   if (string.IsNullOrEmpty(str))
     str = "ControlDefault";
   menu.ThemeName = str;
 }
Exemple #2
0
        protected override bool CanEnterEditMode(GridViewRowInfo rowInfo)
        {
            GridExpanderItem elementAtPoint = GridVisualElement.GetElementAtPoint <GridExpanderItem>((RadElementTree)this.GridViewElement.ElementTree, this.MouseDownLocation);

            if (base.CanEnterEditMode(rowInfo))
            {
                return(elementAtPoint == null);
            }
            return(false);
        }
Exemple #3
0
        protected GridTableElement GetTableElementAtPoint(Point point)
        {
            GridCellElement           elementAtPoint        = GridVisualElement.GetElementAtPoint <GridCellElement>((RadElementTree)this.GridViewElement.ElementTree, point);
            GridDetailViewCellElement detailViewCellElement = elementAtPoint as GridDetailViewCellElement;
            GridTableElement          gridTableElement      = elementAtPoint?.TableElement;

            if (detailViewCellElement != null)
            {
                gridTableElement = detailViewCellElement.ChildTableElement;
            }
            return(gridTableElement ?? this.GridViewElement.TableElement);
        }
        public override bool OnMouseDown(MouseEventArgs e)
        {
            this.disableSortOrderChange = false;
            bool flag = true;

            if (this.GridViewElement.IsInEditMode)
            {
                flag = this.GridViewElement.EndEdit();
            }
            if (e.Button == MouseButtons.Left)
            {
                this.FindCellToResize(e.Location);
                if (this.columnToResize != null)
                {
                    this.mouseIsDown         = true;
                    this.mouseDownPoint      = e.Location;
                    this.GridControl.Capture = true;
                    this.RootGridBehavior.LockBehavior((IGridBehavior)this);
                    this.cellToResize  = this.GridViewElement.ElementTree.GetElementAtPoint(e.Location) as GridCellElement;
                    this.mouseDownCell = this.cellToResize;
                }
                else
                {
                    if (!flag)
                    {
                        return(true);
                    }
                    GridHeaderCellElement cellAtPoint = this.RootGridBehavior.CellAtPoint as GridHeaderCellElement;
                    if (GridVisualElement.GetElementAtPoint <RadButtonElement>((RadElementTree)this.GridViewElement.ElementTree, e.Location) != null)
                    {
                        return(false);
                    }
                    this.mouseDownCell = (GridCellElement)cellAtPoint;
                    if (cellAtPoint == null || this.GetVisibleColumnsCount(cellAtPoint) < 2)
                    {
                        return(false);
                    }
                    RadDragDropService service = this.GridViewElement.GetService <RadDragDropService>();
                    if (service != null)
                    {
                        service.Start((object)new SnapshotDragItem((RadItem)cellAtPoint));
                        service.Stopped     += new EventHandler(this.dragDropService_Stopped);
                        this.dragDropStarted = service.State == RadServiceState.Working;
                    }
                }
            }
            else if (e.Button == MouseButtons.Right)
            {
                this.RootGridBehavior.CellAtPoint?.ShowContextMenu();
            }
            return(false);
        }
Exemple #5
0
 protected virtual IGridBehavior GetRowBehaviorAtPoint(Point point)
 {
     this.rowAtPoint  = GridVisualElement.GetElementAtPoint <GridRowElement>((RadElementTree)this.GridViewElement.ElementTree, point);
     this.cellAtPoint = GridVisualElement.GetElementAtPoint <GridCellElement>((RadElementTree)this.GridViewElement.ElementTree, point);
     if (this.lockedBehavior != null)
     {
         return(this.lockedBehavior);
     }
     if (this.rowAtPoint != null)
     {
         return(this.GetBehavior(this.rowAtPoint.RowInfo.GetType()));
     }
     return(this.GetCurrentRowBehavior());
 }
Exemple #6
0
        protected override void OnDoubleClick(EventArgs e)
        {
            base.OnDoubleClick(e);
            GridViewHyperlinkColumn columnInfo = this.ColumnInfo as GridViewHyperlinkColumn;

            if (columnInfo == null || columnInfo.HyperlinkOpenAction != HyperlinkOpenAction.DoubleClick)
            {
                return;
            }
            RadElement elementAtPoint = GridVisualElement.GetElementAtPoint <RadElement>((RadElementTree)this.GridViewElement.ElementTree, this.clickLocation);

            if (columnInfo.HyperlinkOpenArea != HyperlinkOpenArea.Cell && !(elementAtPoint is GridHyperlinkCellContentElement))
            {
                return;
            }
            this.ProcessHyperlink();
        }
Exemple #7
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));
        }
Exemple #8
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            this.clickLocation = e.Location;
            this.contentElement.IsMouseDown = true;
            GridViewHyperlinkColumn columnInfo = this.ColumnInfo as GridViewHyperlinkColumn;

            if (columnInfo == null || columnInfo.HyperlinkOpenAction != HyperlinkOpenAction.SingleClick)
            {
                return;
            }
            RadElement elementAtPoint = GridVisualElement.GetElementAtPoint <RadElement>((RadElementTree)this.GridViewElement.ElementTree, this.clickLocation);

            if (columnInfo.HyperlinkOpenArea != HyperlinkOpenArea.Cell && !(elementAtPoint is GridHyperlinkCellContentElement))
            {
                return;
            }
            this.ProcessHyperlink();
        }