If you using Stylist, you can use following code snippet to let Stylist recognize printing and draw necessary elements in b/w:
[C#]
public class PrintingStylist : Stylist
{
public override void Draw(StylistDrawInfo sdi)
{
Draw(sdi, false);
}
internal bool Draw(StylistDrawInfo sdi, bool test)
{
switch(sdi.Element)
{
case Parts.Control:
return DrawControlBackground(sdi, test);
case Parts.Cell:
return DrawCell(sdi);
}
return false;
}
internal static bool DrawCell(StylistDrawInfo sdi, bool test)
{
if (!test)
{
//draw to printer - change colors
NineRays.Windows.Forms.Grids.CellDrawInfo cdi = sdi.Context as NineRays.Windows.Forms.Grids.CellDrawInfo;
if (cdi != null && cdi.Preview)
{
cdi.customForeColor = Color.Black;
cdi.customBackColor = Color.White;
return true;
}
}
return true;
}
internal static bool DrawControlBackground(StylistDrawInfo sdi, bool test)
{
if (!test)
{
NineRays.Windows.Forms.Grids.CellDrawInfo cdi = sdi.Context as NineRays.Windows.Forms.Grids.CellDrawInfo;
//draw to print
if (cdi != null && cdi.Preview)
{
using (Brush whiteBrush = new SolidBrush(Color.White))
{
sdi.Graphics.FillRectangle(whiteBrush, sdi.Rectangle);
}
}
else
{
//draw to screen
}
}
return true;
}
}
If you using custom drawing in nodes or columns, you can analyze NineRays.Windows.Forms.Grids.CellDrawInfo.Preview to recognize painting to printer/preview and use another colors.