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
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.
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
Hi Doug,
Did you find any solution to the problem we are facing the same issue with v10.3.
Thanks,
Neeraj
I think it may be because we are using a converter. The other dropdowns are exporting correctly, it is just this one that fails.
<Style x:Key="GAITAccountFieldStyle" TargetType="{x:Type Editors:XamComboEditor }"> <Setter Property="ItemsSource"> <Setter.Value> <MultiBinding Converter="{StaticResource GaitAccountValueConverter}" ConverterParameter="Test"> <Binding Path="Host.DataPresenter.DataContext" RelativeSource="{RelativeSource Self}" /> <Binding Path="DataItem"/> <Binding Path="DataItem.GAITAccountId"/> </MultiBinding> </Setter.Value> </Setter> <Setter Property="DisplayMemberPath" Value="GaitAccountName" /> <Setter Property="ValuePath" Value="GaitAccountId" /> </Style>
Can you post a sample that demonstrates the issue? Also as mentioned in the posts above make sure that you're not using FindAncestor in your binding since that won't work in the cloned grid for export.
Is this issue resolved? We are using the GetCellText method and it is still returning the hidden id not the display value. Note we are using v12.2 with .NET 4.5.
Yes, I also have this problem. Some solution?
I'm still having the same issue even after I upgraded to the latest release.