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
355
Export custom editor to Excel
posted

The XamDataGrid does not support Color data types by default, so I had to implement my own ColorEditor derived from the ValueEditor class.

The ColorEditor handles System.Windows.Media.Color data types and renders them as a filled rectangle showing the color.

Unfortunately when this editor is exported to Excel via the DataPresenterExcelExporter the Color gets converted to string, which is worthless from the user's perspective.

How can I enhance my editor so that the exported Excel cell will have the background color set? Is there an interface I can implement on my ColorEditor? Is there a routed event I can register a class handler to? Is there anything i can do at the editor level?

I know I could derive my own DataPresenterExcelExporter that has unique knowledge of the ColorEditor but that is a very poor solution