Hello,
In infragistics of version 6.1 I used public and not static field UltraGridExcelExporter.ExcelRelevantPropFlags for manage of style excel document.
But now this field is changed to constant.
Could you recommend me the way, I should use to ignore some properties (those are in enum AppearancePropFlags) of appearance for export UltraGrid to excel?
Roman
I am just checking about the progress of this issue. Let me know If you need our further assistance on this matter?
Thank you for using Infragistics Components.
Hi Rowan,
There's no way to globally ignore certain parts of the appearance like you are doing here. I can't see how this code could ever have worked, as that constant has always been a constant and was never a property as far as I can see.
The BeginExport event gives you a layout you can modify in e.Layout. This is a clone of the grid's on-screen DisplayLayout, so you can modify it however you like, but again, there's no way to simply ignore the BackColor or ForeColor on every element. You would have to set or reset the same appearances that are applied to the on-screen grid and leave out the ones you don't want on an individual basis.
It seems you are right.
Explain please how exactly I can ignore properties from AppearancePropFlags using event BeginExport and property e.Layout. I also tried event InitializeColumn:
var data = new AppearanceData();var flags = ~AppearancePropFlags.TextHAlign;e.Column.CellAppearance.MergeData(ref data, ref flags);e.Column.CellAppearance = new Appearance(ref data);
It is strange, e.Column.CellAppearance.TextHAlign is set to value Default
but anyway properties don't ignored in excel file.
Thank you,
Hello Roman,
We have cheeked the code of UltraGridExcelExporter back to 2004th and ExcelRelevantPropFlags was always defined as “public const AppearancePropFlags ExcelRelevantPropFlags”. So if you use it as a property I assume that you have rebuild our source make this constant as a public property. Meanswhile as a workaround we could suggest you to handle BeginExport event and use the e.Layout property of the argument (it returns you cloning of grid layout which will be used for exporting) and to reset needed appearance.
Please let me know if you have any further questions.