-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyGridView.cs
55 lines (50 loc) · 2.32 KB
/
MyGridView.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Developer Express Code Central Example:
// How to customize the GridControl's print output.
//
// This example demonstrates how to override the default exporting process to take
// into account a custom drawn content provided via the
// GridView.CustomDrawFooterCell Event
// (ms-help://DevExpress.NETv10.1/DevExpress.WindowsForms/DevExpressXtraGridViewsGridGridView_CustomDrawFooterCelltopic.htm)
//
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E2667
using System;
using DevExpress.XtraGrid.Views.Base;
using System.Drawing;
using DevExpress.Utils;
using DevExpress.XtraGrid.Columns;
using DevExpress.Utils.Drawing;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Drawing;
namespace MyXtraGrid {
[System.ComponentModel.DesignerCategory("")]
public class MyGridView : GridView {
public MyGridView() : this(null) {}
public MyGridView(DevExpress.XtraGrid.GridControl grid) : base(grid) {
// put your initialization code here
}
protected override string ViewName { get { return "MyGridView"; } }
protected override DevExpress.XtraGrid.Views.Printing.BaseViewPrintInfo CreatePrintInfoInstance(DevExpress.XtraGrid.Views.Printing.PrintInfoArgs args)
{
return new MyGridViewPrintInfo(args);
}
public FooterCellCustomDrawEventArgs GetCustomDrawCellArgs(GraphicsCache cache, Rectangle rect, GridColumn col)
{
GridFooterCellInfoArgs styleArgs = new GridFooterCellInfoArgs(cache);
styleArgs.Bounds = new Rectangle(new Point(0, 0), rect.Size);
FooterCellCustomDrawEventArgs args = new FooterCellCustomDrawEventArgs(cache, -1, col, null, styleArgs);
args.Handled = true;
RaiseCustomDrawFooterCell(args);
return args;
}
public RowIndicatorCustomDrawEventArgs GetCustomDrawRowIndicatorArgs(GraphicsCache cache, Rectangle rect)
{
IndicatorObjectInfoArgs styleArgs = new IndicatorObjectInfoArgs(cache);
styleArgs.Bounds = new Rectangle(new Point(0, 0), rect.Size);
RowIndicatorCustomDrawEventArgs args = new RowIndicatorCustomDrawEventArgs(cache, -1, null, styleArgs);
args.Handled = true;
RaiseCustomDrawRowIndicator(args);
return args;
}
}
}