How to hide particular row when printing.

Hi,

I have grid, when i am preparing the GridPrintDocument(i.e when i click Print, PrintPreview, PageSetup button) i am adding a new row to the grid.And this row is deleted when the task is completed.

Problem is when i click pagesetup button the row is created and is visible.It should be visible only when i see print preview or when i take a print.

Thankyou
Raghavendra.

1 Reply

HA haneefm Syncfusion Team April 16, 2007 05:16 PM UTC

Hi Raghav,

How to hide particular row when the grid is in printing?
>>>>

One way you can hanlde the QueryRowHeight event and set the e.Size to "0" when the grid is in PrintingMode. Here is a code snippet that shows you "How to hide particular row when the grid is in printing?"

this.gridControl1.QueryRowHeight +=new GridRowColSizeEventHandler(gridControl1_QueryRowHeight);

private void gridControl1_QueryRowHeight(object sender, GridRowColSizeEventArgs e)
{
if( this.gridControl1.PrintingMode && e.Index == 4 )
{
e.Size = 0;
e.Handled = true;
}
}

Best regards,
Haneef

Loader.
Up arrow icon