protected override void DrawLine(ViewDrawArgs e, IndentInfo indent)
        {
            if (!IsAllowDrawIndent(indent))
            {
                return;
            }

            CustomDrawLineEventArgs args;
            CellIndentInfo          cellIndentInfo = indent as CellIndentInfo;

            if (cellIndentInfo == null)
            {
                args = new CustomDrawLineEventArgs(e.Cache, indent.Appearance, indent.Bounds, null);
            }
            else
            {
                args = new CustomDrawLineEventArgs(e.Cache, indent.Appearance, indent.Bounds, cellIndentInfo.Cell);
            }

            View.RaiseCustomDrawGridLine(args);
            if (args.Handled)
            {
                return;
            }
            base.DrawLine(e, indent);
        }
 public virtual void ShowControl(ViewDrawArgs e)
 {
     if (InternalContainer == null)
     {
         return;
     }
     InternalContainer.Bounds  = TabControl.CalcPageClient(e.Bounds);
     InternalContainer.Visible = true;
 }
Example #3
0
        protected override void DrawEmbeddedBorder(ViewDrawArgs e)
        {
            base.DrawEmbeddedBorder(e);
            GridView detailView = e.ViewInfo.View as GridView;

            if (detailView == null)
            {
                return;
            }
            int             sourceRowHandle = detailView.SourceRowHandle;
            GridView        parentView      = detailView.ParentView as GridView;
            GridViewInfo    parentViewInfo  = parentView.GetViewInfo() as GridViewInfo;
            GridViewInfo    detailViewInfo  = (GridViewInfo)detailView.GetViewInfo();
            GridDataRowInfo ri = parentViewInfo.RowsInfo.Where(rinfo => rinfo.RowHandle == sourceRowHandle).First() as GridDataRowInfo;

            if (ri == null)
            {
                return;
            }

            GridCellInfo cell = ri.Cells[parentView.VisibleColumns[0]];
            int          center;
            int          level = 0;
            Point        p1;
            Point        p2;
            int          lineIndent = 4;

            if (cell != null)
            {
                center = cell.CellButtonRect.Left + cell.CellButtonRect.Width / 2 - lineIndent;
            }
            else
            {
                center = ri.DetailIndentBounds.Left + ri.DetailIndentBounds.Width / 2;
            }

            foreach (GridRowInfo rowInfo in detailViewInfo.RowsInfo)
            {
                if (detailView.IsRowVisible(rowInfo.RowHandle) != RowVisibleState.Visible)
                {
                    continue;
                }
                level = rowInfo.Bounds.Top + rowInfo.Bounds.Height / 2;
                if (level != 0)
                {
                    p1 = new Point(center, level);
                    p2 = new Point(ri.IndentRect.Right + parentViewInfo.DetailIndent, level);
                    e.Cache.DrawLine(Pens.Black, p1, p2);
                }
            }
            if (level != 0)
            {
                p1 = new Point(center, ri.Bounds.Bottom);
                p2 = new Point(center, level);
                e.Cache.DrawLine(Pens.Black, p1, p2);
            }
        }
Example #4
0
        protected virtual void ShowTitle(ViewDrawArgs e)
        {
            CustomView view = (View as CustomView);
            string     text = String.Format("{0}: {1}", view.LevelName, view.Name);

            e.Cache.FillRectangle(Color.White, e.Bounds);
            e.Cache.DrawRectangle(new Pen(Color.Gray, 1), e.Bounds);
            Font font = new Font(view.GridControl.Font.FontFamily, 18);

            e.Cache.DrawString(text, font, e.Cache.GetSolidBrush(Color.Gray), e.Bounds, StringFormat.GenericDefault);
        }
Example #5
0
        public override void Draw(ViewDrawArgs e)
        {
            CustomView view = (View as CustomView);

            if (view.GridControl.IsDesignMode)
            {
                ShowTitle(e);
                return;
            }
            view.ShowControl(e);
            base.Draw(e);
            DrawBorder(e, e.ViewInfo.Bounds);
        }
Example #6
0
 protected override void DrawFilterPanel(ViewDrawArgs e)
 {
     if (viewInfo == null)
     {
         viewInfo = (e.ViewInfo as CustomGridControlViewInfo);
     }
     viewInfo.CheckMRUButton();
     if (!viewInfo.DrawMRU)
     {
         viewInfo.FilterPanel.MRUButtonInfo.Bounds = new Rectangle();
     }
     base.DrawFilterPanel(e);
     viewInfo.CalcButtons();
     DrawButtons(e.Cache, viewInfo.RightButtons);
     DrawButtons(e.Cache, viewInfo.LeftButtons);
 }