-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyGridPainter.cs
29 lines (24 loc) · 1.03 KB
/
MyGridPainter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.Drawing;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Base.ViewInfo;
namespace DXSample {
public class MyGridPainter: GridPainter {
public MyGridPainter(GridView view) : base(view) { }
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 new MyGridView View {
get { return base.View as MyGridView; }
}
}
}