Hi All,
My grid uses alternate row colors, some columns are icons. How to export those data to excel with alternate background colors?One approch came to my mind, to achieve this requirement partially, is to make use of RecordExporting event as shown below int count = 1; void export_RecordExporting(object sender, RecordExportingEventArgs e) { System.Drawing.Color rowColor; if (count % 2 == 0) { rowColor = System.Drawing.Color.Gray; } else { rowColor = System.Drawing.Color.Transparent; } e.Workbook.Worksheets[0].Rows[count].CellFormat.FillPatternBackgroundColor = rowColor; count++; }
Any thoughts is greatly appreciated
regardsAjosh
Ajosh,
I would probably suggest similar approach what you already know as there is no built-in functionality to set an alternating style.
Sincerely,
Sam