以下示例代码演示了如何将打印外观和背景颜色自定义应用于网格控件中的偶数行。
gridView1.OptionsPrint.UsePrintStyles = true;
// Enable the AppearancePrint.EvenRow property's settings.
gridView1.OptionsPrint.EnableAppearanceEvenRow = true;
// Set the background color of the even rows.
gridView1.AppearancePrint.EvenRow.BackColor = Color.LightYellow;
结果如下图所示。