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
Hi Andrew,
I am using a enum of a map (actual value,display value) in the converter. Getcelltext doesn't work in that case. Anything else you know of?
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?