Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
ExcelExporter exports value for Combobox
posted

Hi,

We are using XamGrid v14.0 and using ExcelExporter to export the grid.

One of our fields uses Unbound and has a ComboBox in ControlTemplate, when exporting to Excel the value is always empty. Here is the cell in xamdatagrid:

<dataPresenter:UnboundField x:Name="Code" Label="Code">
                                                    <dataPresenter:UnboundField.Settings>
                                                        <dataPresenter:FieldSettings LabelTextAlignment="Left">
                                                            <dataPresenter:FieldSettings.CellValuePresenterStyle>
                                                                <Style TargetType="{x:Type dataPresenter:CellValuePresenter}">
                                                                    <Setter Property="Template">
                                                                        <Setter.Value>
                                                                            <ControlTemplate>
                                                                                <ComboBox ItemsSource="{Binding DataItem.Parent.Codes}" 
                                                                                          DisplayMemberPath="MyCode" 
                                                                                          SelectedItem="{Binding DataItem.Code, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding DataItem.Enabled}"/>
                                                                            </ControlTemplate>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                </Style>
                                                            </dataPresenter:FieldSettings.CellValuePresenterStyle>
                                                        </dataPresenter:FieldSettings>
                                                    </dataPresenter:UnboundField.Settings>
                                                </dataPresenter:UnboundField>