Hi
I'm exporting the grid's values and I need to have the boolean values translated. How should I do this?
HI,
Wire up the Exporter's CellExported Event and change the cell value
Here is the code snippets:
DataPresenterExcelExporter exporter = new DataPresenterExcelExporter();
ExportOptions eo = new ExportOptions();
exporter.CellExporting += new EventHandler<CellExportingEventArgs>(exporter_CellExporting);
exporter.CellExported += new EventHandler<CellExportedEventArgs>(exporter_CellExported);
exporter.Export(this.xgrid1, "xamDataPresenter1.xlsx", WorkbookFormat.Excel2007,eo);
void exporter_CellExported(object sender, CellExportedEventArgs e)
{
if (e.Field.Name == "Married")
{ if (e.Value.ToString().ToUpper() == "TRUE")
e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = "Married";
else
e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = "Single";
} //throw new NotImplementedException(); }
Please let me know if you need further assistance regarding this issue.