// Handle C1FlexGridPrintable2.PrintCell event: // if we are printing the first cell containing an expanded child grid, // we use C1FlexGridPrinter to insert a RenderTable representing that // child grid into that cell. protected override void OnPrintCell(PrintCellEventArgs e) { base.OnPrintCell(e); if (!IsExpandedChildGridCell(e.Row, e.Col)) { return; } // get child grid occupying the current row: C1FlexGrid childGrid = (C1FlexGrid)Rows[e.Row - 1].UserData; System.Diagnostics.Debug.Assert(childGrid != null); C1FlexGridPrinter childPrinter = new C1FlexGridPrinter(childGrid); // use our own PrintInfo on the child: childPrinter.PrintInfo = this.Printer.PrintInfo; // make render object representing the child: C1.C1Preview.RenderObject childRO = childPrinter.MakeGridTable(e.TableCell.Table.Document); // span all columns to the right: e.TableCell.SpanCols = e.TableCell.Table.Cols.Count - 1; // allow the nested table to be split horizontally: e.TableCell.Table.Rows[e.TableCell.Row].SplitBehavior = C1.C1Preview.SplitBehaviorEnum.SplitIfNeeded; // set our cell's render object to the child grid: e.TableCell.RenderObject = childRO; }
/// <summary> /// Raises the <see cref="C1FlexGridPrintable2.PrintCell"/> event. /// </summary> /// <param name="e">Event arguments.</param> protected internal virtual void OnPrintCell(PrintCellEventArgs e) { if (_printCellEventHandler != null) { _printCellEventHandler(this, e); } }