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
975
Export to excel extract information from CellValuePresenter and
posted

Hi,

When exporting to excel I need to extract background color, border brush, border thickness from the CellValuePresenter and DataRecordPresenter. I've check in the CellExporting event arguments but haven't found a way to extract the CellValuePresenter and the DataRecordPresenter

The gold is to mimic the visual of the Grid.

Regards,

Dominik

Parents
  • 12773
    posted

    Hi,

    I am not sure which exact grid you want to mimic but as far I can see you are interested of CellValuePresenter style and here  and here you can see similar discussions where we got the styles , for example CellValuePresenterStyle can be found from the e.Field.Settings.CellValuePresenterStyle in the  CellExporting event.

    void exporter_CellExporting(object sender, CellExportingEventArgs e)

            {

             Style celllStyle = e.Field.Settings.CellValuePresenterStyle;              

    if (celllStyle == null )

                        {//do your checks, here             }

            }

    You can get the style and follow similar approach on the attached sample to apply it in the excel cells. Similar approach can be used for the DataRecordPresenter.

Reply Children