My scenario: I have a single-banded grid. When no columns are grouped, the column headers appear at thetop of the grid. But when I group by one of the columns, the column headers are removed from the top of the grid, and do appear at the top of each group when that group is expanded.
If I apply the following:
UltraGrid1.DisplayLayout.ViewStyle = Infragistics.Win.UltraWinGrid.ViewStyle.SingleBand
the column headers appear only once (at the top of the grid) and do not appear when I expand each group. This is fabulous, especially when I have numeric columns which are summed - when grouping, my user can see summarized totals, and can expand to see detail.
However, when exporting the grid to excel, the UltraGridExcelExporter does not appear to perform equivalently, which means that my users are forced to expand a group to see the column headings, and the column headings are then repeated continuously throughout the excel document.
Is there a way to get the UltraGridExcelExporter to perform the equivalent function that the grid performs when setting the ViewStyle property to SingleBand - ie to show the column headings only once, and at the top of the excel document?
Attached is a sample project that loads a simple grid with data, creates a summary, and toggles the ViewStyle property, so that you can see that the UltraGridExporter produces the same result regardless of the ViewStyle property setting. Beware that this project will write a file C:\Test.xls if you export. There is a sample.xls file that depicts what I am asking for here.
Thanks,
Walter
Hi Walter,
The ViewStyle basically just resolves the HeaderPlacement property, and the HeaderPlacement is currently not honored by the UltraGridExcelExporter. This is a known bug.
Hi Mike,
I am using Infragistics 2013 Win controls in my application. Can you tell me if above known bug is fixed in this latest version. My requirement is also same like above , I don't want to show column headers for each row in the band (In Excel File).
Please help me regarding this.
Sudheer K
Hi,
I'm pretty sure that this was fixed a long time ago. The export should honor the HeaderPlacement property in the latest version - or at least as well as can be supported by Excel. So you just need to handle ExportStarted and modify the layout passed into the even and set HeaderPlacement to FixedOnTop.
Thanks for your help. Yes header placement has fixed my problem.
ultraGrid1.DisplayLayout.Override.HeaderPlacement = HeaderPlacement.OncePerGroupedRowIsland;