Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
690
Ultragrid selective print issue in hierarchical data
posted

Hi,

My data source to ultragrid is dataset containing two tables in relation, so it displays hierarchical data in ultragrid. Now, i have a situation where i need to print all the parent rows but selective child rows only. Is there anyway to do such selection while i am printing my datagrid??

following is my pseudo code that is being used to print my grid:-

1. Initially i am expanding all rows.

2. objUltraGridPrintDocument. Datasource= ultragrid.

3.objUltraPrintPreviewDialog.Document = objUltraGridPrintDocument

4. objUltraPrintPreviewDialog.Document.Print()

I was wondering if there is any event in UltraGridPrintDocument or UltraPrintPreviewDialog i can use to hide or avoid some child rows being pritned.??

Thanks
Miztaken 

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    What you should do is handle the InitializeRow event of the grid (the UltraGrid, not the UltraGridPrintDocument).

    Inside this event check e.Row.Layout.IsPrintLayout. If this is true, then the row being initialized is being initialized for printing. You can examine the row (or it's parent) and then set the Hidden property on it to true to hide that row. This will hide the print row and have no effect on the on-screen row.

Children