コード例 #1
0
        void OnMouseMove(object sender, MouseEventArgs e)
        {
            GridHitInfo hitInfo = view.CalcHitInfo(e.Location);

            if (hitInfo.HitTest == GridHitTest.Row && view.IsGroupRow(hitInfo.RowHandle))
            {
                GridViewInfo       viewInfo = view.GetViewInfo() as GridViewInfo;
                GridGroupRowInfo   rowInfo  = viewInfo.GetGridRowInfo(hitInfo.RowHandle) as GridGroupRowInfo;
                GridColumn         col      = viewInfo.GetNearestColumn(e.Location);
                GridColumnInfoArgs args     = viewInfo.ColumnsInfo[col];
                if (col.VisibleIndex == 0)
                {
                    HotTrackRectangle = new Rectangle(rowInfo.ButtonBounds.Right + 2, rowInfo.Bounds.Y,
                                                      args.Bounds.Width + args.Bounds.X - rowInfo.ButtonBounds.Right - 2, rowInfo.Bounds.Height);
                }
                else
                {
                    HotTrackRectangle = new Rectangle(args.Bounds.X + 2, rowInfo.Bounds.Y,
                                                      args.Bounds.Width - 2, rowInfo.Bounds.Height);
                }
            }
            else
            {
                HotTrackRectangle = Rectangle.Empty;
            }
        }
コード例 #2
0
        private void DrawGroupEditor(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            GridViewInfo     viewInfo         = view.GetViewInfo() as GridViewInfo;
            GridColumn       col              = viewInfo.GetNearestColumn(HotTrackRectangle.Location);
            BaseEditPainter  groupEditPainter = GetGroupEditPainter(col);
            BaseEditViewInfo editViewInfo     = GetGroupEditViewInfo(col);

            editViewInfo.Bounds = HotTrackRectangle;
            editViewInfo.CalcViewInfo(e.Graphics);
            e.Cache.FillRectangle(viewInfo.PaintAppearance.Row.GetBackBrush(e.Cache), HotTrackRectangle);
            groupEditPainter.Draw(new ControlGraphicsInfoArgs(editViewInfo, e.Cache, HotTrackRectangle));
        }
コード例 #3
0
        void OnMouseDown(object sender, MouseEventArgs e)
        {
            GridHitInfo hitInfo = view.CalcHitInfo(e.Location);

            if (e.Button == MouseButtons.Left && HotTrackRectangle.Contains(e.Location))
            {
                if ((SingleClick && e.Clicks == 1) || (!SingleClick && e.Clicks == 2))
                {
                    view.FocusedRowHandle = hitInfo.RowHandle;
                    GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo;
                    GridColumn   col      = viewInfo.GetNearestColumn(e.Location);
                    ShowGroupEditor(col);
                    DXMouseEventArgs.GetMouseArgs(e).Handled = true;
                }
            }
        }