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
130
XamComboEditor Object Binding
posted

Hi,

I'm not able to get the selected value of a XamComboEditor in a XamDataGrid context :

                    <igDP:UnboundField Column="8" BindingPath="Fonction.DataValue" Label="Fonction" Width="Auto" BindingMode="TwoWay">
                        <igDP:UnboundField.Settings>
                            <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">
                                <igDP:FieldSettings.EditorStyle>
                                    <Style TargetType="{x:Type igEditors:XamComboEditor}">
                                        <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},Path=DataContext.StatutsTvaSelectionnables, Mode=OneWay}" />
                                        <Setter Property="DisplayMemberPath" Value="Libelle" />
                                    </Style>
                                </igDP:FieldSettings.EditorStyle>
                            </igDP:FieldSettings>
                        </igDP:UnboundField.Settings>
                    </igDP:UnboundField>

As you can see, my UnboundField is binded to a property which is an object of the same type as those in the XamComboEditor ItemsSource. My problem is that the XamComboEditor doesn't return the selected object (like a ComboBox via the SelectedItem property) but a string (that you can customise with the ValuePath property). What should I do to get the selected object in my target property ?

Regards,

Sébastien ORGEAS