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.??
ThanksMiztaken
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.
wow this is what i wanted. Thanks Mike. :)