I'm trying to customize the output format of a grid. Code that logically should work, seems to have no effect...
which points to:
| // Add event handler |
| grid.GridExporting += new OnGridExportingEventHandler(grid_GridExporting); |
| // The handler: showing only the PDF branch |
| static void grid_GridExporting(object source, GridExportingArgs e) |
| { |
| RadGrid grid = (RadGrid)source; |
| switch (e.ExportType) |
| { |
| case ExportType.Pdf: |
| ApplyStylesToPDFExport(grid.MasterTableView); |
| break; |
| } |
| } |
Which calls:
| // The routine, trimmed to simple example... the code executes when I step thru it... |
| static void ApplyStylesToPDFExport(GridTableView gtable) |
| { |
| foreach (GridColumn col in gtable.Columns) |
| { |
| col.HeaderStyle.BackColor = System.Drawing.Color.Silver; |
| col.HeaderStyle.ForeColor = System.Drawing.Color.Red; |
| } |
| } |
So what am I doing wrong OR how can I do the equivalent. The PDF export is done by the built-in export buttons... All of the code is in a Utility class because it will be used on dozens of pages...