Hi, We have a UltraGrid with some summary columns. As per default implementation of ultra grid only summary cells will have grey as background color, but we want whole summary row's background color as Grey. We have achieved this by implementing IUIElementDrawFilter. So now whole summary row has grey as background color.If we export the same grid in excel using UltraGridExcelExporter then it is not exporting changes we have made using IUIElementDrawFilter. So in summary row only summarized cells having grey as background color and other columns has white background color.We want to set non-summarized cells background color of summary row as grey in exported file. I tried to set the appearance setting in different UltraGridExcelExporter's event but I am not getting proper place to do it.Is there any way to achieve this? Or if there is any way to change appearance of summary row then also it will be helpful because background color will be fixed in whole application.
Thanks.Ganesh
Hi Ganesh,
I DrawFilter will not affect exporting. But I don't think you need a DrawFilter for what you want. It sounds like you can acheive this much more easily using the SummaryFooterAppearance on the override.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; band.Summaries.Add(SummaryType.Sum, band.Columns[0]); band.Override.SummaryFooterAppearance.BackColor = Color.Gray; }
Hi Mike, It works fine in grid, but if I export grid data in Excel using UltraGridExcelExporter then it is not exporting changes made in SummaryFooter appearance. Is this a default behavior or I need to set any settings while exporting?
Thanks,Ganesh
Sorry, it looks like this is by design. The exporter doesn't color the empty cells.
Here's another way you could do it:
private void ultraGridExcelExporter1_SummaryRowExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.SummaryRowExportingEventArgs e) { int columnCount = 5; for (int x = 0; x < columnCount; x++) { e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex + x].CellFormat.FillPatternBackgroundColor = Color.Gray; } }
You will have to determine the correct 'columnCount', of course, based on the number of visible columns in your grid.