This example creates a custom Grid Control with new custom draw events (SamplePrintEvent
, HeaderPrintEvent
) that allow you to paint data cells and column headers in print preview:
private void MyGridView1_HeaderPrintEvent(object sender, HeaderPrintEventArgs args) {
args.Brick.Style.BackColor = Color.PowderBlue;
}
private void simpleButton2_Click(object sender, EventArgs e) {
myGridControl1.ShowPrintPreview();
}
- Customer.cs (VB: Customer.vb)
- Form1.cs (VB: Form1.vb)
- HeaderPrintEventArgs.cs (VB: HeaderPrintEventArgs.vb)
- MyGridControl.cs (VB: MyGridControl.vb)
- MyGridViewPrintInfo.cs (VB: MyGridViewPrintInfo.vb)
- SamplePrintEventArgs.cs (VB: SamplePrintEventArgs.vb)
(you will be redirected to DevExpress.com to submit your response)