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
Hi Dimi,
This gives the CellValuePresenterStyle, I tried to use it however the information I need is really in the CellValuePresenter object.
I would need the CellValuePresenter not the Style, also I need to have access to the DataRecordCellArea.
I just realise that it might be impossible if the CellValuePresenter is dynamically created upon demand, is that possible?
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.