private Rectangle GetBoundsByRecordIndex(int recordIndex, DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi)
        {
            DevExpress.XtraVerticalGrid.ViewInfo.BaseRowViewInfo vInfo = vi.RowsViewInfo[0];
            if (vInfo == null)
            {
                return(Rectangle.Empty);
            }
            Rectangle bounds = GetValueBoundsByRecordIndex(vInfo, recordIndex);

            if (vInfo.ValuesInfo.Count > recordIndex + 2)
            {
                bounds.Width += GetValueBoundsByRecordIndex(vInfo, recordIndex + 1).Right - bounds.Right;
            }
            else
            {
                bounds.Width += vi.RowsViewInfo[0].RowRect.Right - bounds.Right;
            }
            return(bounds);
        }
 protected override void DoDrawCore(DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi)
 {
     base.DoDrawCore(vi);
     DrawButton(vi);
 }
        protected override void DrawRowValueCellCore(CustomDrawRowValueCellEventArgs e, DevExpress.XtraEditors.Drawing.BaseEditPainter pb, DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo bvi, DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi)
        {
            if (e.Row.VisibleIndex != 0)
            {
                base.DrawRowValueCellCore(e, pb, bvi, vi);
                return;
            }
            if (e.RecordIndex % 2 == 0 || vi.RowsViewInfo[0].ValuesInfo[0].RecordIndex == e.RecordIndex)
            {
                Rectangle bounds = GetBoundsByRecordIndex(e.RecordIndex, vi);
                bvi.Bounds = bounds;
                bvi.CalcViewInfo(e.Graphics);
                EventHelper.DrawnCell.Bounds = bounds;

                FieldInfo fi = typeof(RowValueInfo).GetField("DrawFocusFrame", BindingFlags.Instance | BindingFlags.NonPublic);
                fi.SetValue(EventHelper.DrawnCell, false);

                e.Appearance.Assign(vi.PaintAppearance.RowHeaderPanel);
                base.DrawRowValueCellCore(e, pb, bvi, vi);
                return;
            }
        }
 public SingleRecordScrollStrategyDescendant(DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo viewInfo)
     : base(viewInfo)
 {
 }
Esempio n. 5
0
        public static Rectangle GetCellBounds(CustomDrawRowValueCellEventArgs e, DevExpress.XtraEditors.Drawing.BaseEditPainter pb, DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo bvi, DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi)
        {
            Rectangle  result     = e.Bounds;
            MergedType mergedType = GetMergedType(e);

            if (mergedType == MergedType.Regular)
            {
                return(result);
            }
            if (mergedType == MergedType.Middle)
            {
                return(Rectangle.Empty);
            }
            return(GetFirstMergedCellBounds(e, vi));
        }
Esempio n. 6
0
 protected override void DrawRowValueCellCore(CustomDrawRowValueCellEventArgs e, DevExpress.XtraEditors.Drawing.BaseEditPainter pb, DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo bvi, DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi)
 {
     if (e.Row.VisibleIndex == 0)        //for header row
     {
         Rectangle bounds = MergedRowsHelper.GetCellBounds(e, pb, bvi, vi);
         bvi.Bounds = bounds;
         bvi.CalcViewInfo(e.Graphics);
         EventHelper.DrawnCell.Bounds         = bounds;
         EventHelper.DrawnCell.DrawFocusFrame = false;
         e.Appearance.Assign(vi.PaintAppearance.RowHeaderPanel);
     }
     base.DrawRowValueCellCore(e, pb, bvi, vi);
 }