Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
Xamdatagrid export to word, formatted fields
posted

Hello,

I want to know if this is expected or if I'm missing something:

I have a Xamdatagrid with dynamically generated columns. With a Multiconverter I am setting the Background Property of the CellValuePresenter (using a style triggered by true/false) to either red or green. The logic (to set the background to green/red) is embedded in the Converter and works fine.

Now when exporting to a word document, the background color is not beeing exported. I was not expecting this.

How can I keep the background color when exporting to a word document ? 

Note that in the logic required to set the background color, I need to check a property at runtime. So I don't know which color it will have beforehand (i.e. the approach in the samples browser "Word Export Styling" is not adequate).

Another question is:

How can I export multiple xamdatagrids (these are inside different TabItems) into a single word document ?

Thank you in advance.

Best regards,

Julian

Parents
No Data
Reply
  • 7375
    Verified Answer
    Offline posted

    Hello Julian,

    I have been looking into your requirements and find DataPresenterWordWriter /DataPresenterExcelExporter only export the visual element, It will not export the grid style directly.

    What you can do , handle the CellExporting event and set the backcolor with the cellSetting( e.CellSettings.BackColor)

    With the CellExportingEventArgs e you can have access to recod and dataitem to set the backcolor as per your requirement.
    I attached here a small demo sample for your reference.

    About your second requirement of exporting multiple xamdatagrids into a single word document, we do not have any method/property exposed to do that. This would be a new feature idea for us.

    You can mention this new product idea here for future versions (or vote for existing ones) at <ideas.infragistics.com>.

    Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    Regards,

    6215.WpfApp1.zip

Children
No Data