Export DataGridVeiw to excel in C# with cell background colors


you can use cells.interior.color

Range range = 
            oSheet.get_Range("A" + redRows.ToString(), "J"
                                    + redRows.ToString());

    range.Cells.Interior.Color = System.Drawing.Color.Red; 

for more info check Microsoft interop excel to format excel cells


I got the solution, I just went though the source from where I was setting the color, put each cell or DataGridView in loop and through range, applied the colors.

Thanks To All For Your Help

链接地址: http://www.djcxy.com/p/36774.html

上一篇: 在Android应用程序中存储用户设置的最合适方式是什么?

下一篇: 将DataGridVeiw导出为在C#中使用单元格背景色进行优化