Hello.
See ExportEnum.png
How to fix this?
We have closed this ticket because another page addresses its subject:
ASPxGridViewExporter don't translate enumsExport to Excel (and other) doesn’t use DisplayNameAttibute for enums.
Answers
Hello Alexey,
Thank you for contacting us. You can implement a solution described in the duplicate ticket: ASPxGridViewExporter don't translate enums.
---------------
Check if Search Engine is able to answer questions faster than I do!
---------------
I solve problem in my case with controller:
public class FixExportViewController : ViewController<ListView>
{
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
var editor = View.Editor as ASPxGridListEditor;
if (editor == null)
return;
var exporter = editor.Printable as ASPxGridViewExporter;
if (exporter == null)
return;
exporter.RenderBrick += exporter_RenderBrick;
}
void exporter_RenderBrick(object sender, ASPxGridViewExportRenderingEventArgs e)
{
if(e.Value is Enum)
{
e.Text = new EnumDescriptor(e.Value.GetType()).GetCaption(e.Value);
}
}
}
Most users expect to see in export what they see in the listview.
This is especially true for non-english speaking users (DislayName different from enum name).
Is it possible to use DislayName for enum by default in export?
Thank you for the feedback, Alexey. I am glad to hear that you have solved this problem as suggested.
As for your last question, we already have a similar feature request in our TODO list and we will take your feedback into account.