DataPresenterExcelExporter は基本的にセルの Value をバインドされた値のまま Excel ファイルにエクスポートします。
例えば、以下の「Test1」列のように、Mask プロパティによって表示テキストが変更されている場合、

<igWPF:XamDataGrid .....  >
.....
	<igWPF:XamDataGrid.FieldLayouts>
		<igWPF:FieldLayout>
			<igWPF:FieldLayout.Fields>
				<igWPF:Field Name="Id" />
				<igWPF:MaskedTextField Name="Test1" Mask="###-##-####" />
				<igWPF:Field Name="Test2"/>
			</igWPF:FieldLayout.Fields>
		</igWPF:FieldLayout>
	</igWPF:XamDataGrid.FieldLayouts>
</igWPF:XamDataGrid>

Excel には Mask 適用前のセルの値が出力されます。

XamDataGrid のセルに表示されているテキストをそのまま Excel にエクスポートするには、DataPresenterExcelExporter の CellExported イベントでワークシートにセルの値が書き込まれた後で値を編集します。XamDataGrid のセルに表示されているテキストは、イベント引数よりアクセスすることのできる DataRecord インスタンスの GetCellText() メソッドによって取得することができます。

private void DataPresenterExcelExporter_CellExported(object sender, CellExportedEventArgs e)
{
	if (e.Field.Name == "Test1")
	{
		e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = e.Record.GetCellText(e.Field);
	}
}

Mask 適用済みのテキストでエクスポートすることができました。

製品について

Ultimate UI for WPF