Hey,
I want to export a grid that has combo editor fields. My problem is that, by default, it is exporting the values and not the display members.
Looking at the excel exporter, I saw that it has a CellExporting event where I can set a custom Value on the event args. I'm guessing that this would be the ideal spot for me to somehow grab the text? My problem is that CellValuePresenter.FromRecordAndField returns null here. I want to use CellValuePresenter.Editor.Text as the Value. Am I doing something wrong? In the worst case, I suppose I could use the Cell's value to key into my drop down list and get out the displayed text myself -- is this my best option?
Thanks
No workaround should be needed as the original issue was addressed well before 10.3. I've attached a sample that uses 10.3 and it correctly exports the DisplayMember from the combo column. Can you post a sample that demonstrates the problem?
Hi Doug,
Did you find any solution to the problem we are facing the same issue with v10.3.
Thanks,
Neeraj
This workaround does not appear to work in 10.3. The GetCellText method simply returns the ID value of the combobox not the display text. Any help would be appreciated.
Thanks,Doug Rees
Polo Ralph Lauren
GetCellText works perfectly, thank you for your help.
This doesn't seem like correct behavior. I would have expected the display text for this field to have been exported but I have submitted an issue for this so the matter can be investigated further. In the interim you could try handling the CellExported event and set the worksheet cell's value directly. e.g.