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
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 Andrew,
The sample provided by you works correctly. But for some reason the below code doesn't work for me
Please look at the code snippet which I use to set the DisplayMemberPath and ValuePath to value and Id properties of AdditionalDesc.
<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding Path=DataContext.AdditionalDesc, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" /> <Setter Property="Background" Value="{Binding Path=Value,RelativeSource={RelativeSource Self}, Converter={StaticResource NullValueToRedBrushConverter}}"/> <Setter Property="DisplayMemberPath" Value="Value" /> <Setter Property="ValuePath" Value="Id" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings>
Thanks,
Neeraj
Hello Neeraj,
I have created a support case number CAS-69345-9H52M9 for you about this behavior and I have linked it with Development issue 82921 on our internal tracking system.
I will leave this case open and update you with any new information after the review. You can also continue to send updates to this case at any time.
You can view the status of the development issue connected to this case by going to the “My IG” tab on our website, hovering to the "My Support Activity" dropdown and selecting the "Development Issues" tab.
Please let me know if you need more information.
The service release containing the fix for your issue is out, you can download it from: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
I'd be glad to receive a feedback on the outcome.
I'm still having the same issue even after I upgraded to the latest release.
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?