Home Forums WinForms controls Xceed Grid for WinForms Problem Printing Custom Elements: Reply To: Problem Printing Custom Elements:

Xceed Support
Member
Post count: 5658

I tried to reproduce this issue and I was not able to.

I created a custom TextRow and added it to the FixedHeaderRows of my grid. The Grid included the TextRow using the GenerateReportForm class and the Report class.

My custom TextRow:
<code>
public class MyTextRow : TextRow
{
public MyTextRow()
: base()
{
}

public MyTextRow( string text )
: base( text )
{
}

protected MyTextRow( MyTextRow template )
: base( template )
{
}

protected override Row CreateInstance()
{
return new MyTextRow( this );
}

public override Borders Borders
{
get
{
return base.Borders;
}
}

protected override void PaintBorders( GridPaintEventArgs e )
{
base.PaintBorders( e );
}

protected override void PaintBackground( GridPaintEventArgs e )
{
base.PaintBackground( e );
}

protected override void PaintForeground( GridPaintEventArgs e )
{
base.PaintForeground( e );
}
}
</code>

The code I used to add the Custom TextRow and generate the Report:
<code>
MyTextRow newRow = new MyTextRow( “I’m a custom TextRow” );

gridControl1.FixedHeaderRows.Add( newRow );

Report report = new Report( gridControl1 );
report.PrintPreview();
</code>

Imported from legacy forums. Posted by CharlesB (had 239 views)