I have formatted couple of Columns within the XAMDataGrid using the following Feature
<Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value="nnn,nnn,nnn,nnn.nn"/> <Setter Property="NullText" Value="-" /> </Style>
However when I export the Grid to Excel, the formatting of number is lost for e.g. the comma's go missing. Also huge numbers like 150000000000 are displayed as 1.5E+11. Numbers with decimal places as XXX.00 are displayed as XXX. When we manually change the format on the excelsheet to number, the value displayed is as desired.
I am not able to manually export each row and each column as the Grid might have grouping which we wish to have in the same format while export to excel.
Can you please help me with this?
Hello Aniket,
I am just checking if the latest reply helped you out and if you require any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Hi Dimi
In the sample project you attached earlier, how can I format percentage column?
is it possible to provide list of excel style formatting strings? Excel cells can be Number, Currency, accounting, Date, Time, Percent, Fractions, Scientific etc Can we specify .NET string formatting styles?
Thank you for the example.
Question was regarding style/state of grid based on DataTrigger! Can styles from data triggers be extracted like you did with cell styles? Can you show it with example.
Hi Abbas,
The sample should work for triggers too, just add a trigger. If your trigger set some value to the setter and reflect on your cell style. When you export it the sample is retrieving the setter value so it should take current value of the cell setter and should be exported to excel with the current cell style.
Please let me know if this is working for you or if you have any furthered questions.
Just tried a grid with data trigger and it does not bring styles based on triggers in excel.
I am attaching your sample with data triggers and see the problem when styles based on data triggers are not exported.
Attached you can find the sample demonstrating manually exporting styles with triggers to excel. I have played with it to make exported the triggers base on the cell condition. Please let me know if you have any furthered questions.
I just received a little more information from our development team about this product idea. For now we are not considering implementing it and this should be done by the provided approach earlier in this thread.
In WPF application we can put various themes and styles with triggers that change the look of various elements, etc. They are applied to elements that are virtualized so we don’t have a way to determine on which non viewable elements have to apply styling in order to export it.
I hope this helps.
Hi Abbas
I will update you if I have more information about this feature.
Thank you for using Infragistics and participating in the development of the product by providing your feedback.
Hi again,
Thank you for the prompt response. Looking forward to see this feature in coming releases.
I understand your scenario and I have research this furthered and I have opened for you a product idea -PI12080147. I have sent your product idea directly to our product management team. Infragistics continues to monitor application development for all of our products so as trends appear in requested features, we can plan accordingly. If your feature is chosen for development you will be notified at that time.
Please let me know if you have any furthered questions or you need more assistance on this.
If there is no further recommendation, please say so!