protected override void DrawRowValueCellCore( DevExpress.XtraVerticalGrid.Events.CustomDrawRowValueCellEventArgs e, DevExpress.XtraEditors.Drawing.BaseEditPainter pb, DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo bvi, DevExpress.XtraVerticalGrid.ViewInfo.BaseViewInfo vi) { VGridControlDescendant Grid = vi.Grid as VGridControlDescendant; if (Grid.RecordCount - 1 == e.RecordIndex && Grid.FocusedRecord != -1) { if (!Grid.AllowNew) { base.DrawRowValueCellCore(e, pb, bvi, vi); } } else { base.DrawRowValueCellCore(e, pb, bvi, vi); } }
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)); }
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; } }
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); }