Hello,
I have a problem with the OneWay BindingMode using a XamComboEditor : the selected item is updated only the first time I change the source.
If I use the TwoWay mode it's working perfectly (but the source is updated if I change the selected item and that's not what I want).
Here's my code :
<igEditors:XamComboEditor ValuePath="ColonneName" DisplayMemberPath="LibelleSource" ItemsSource="{Binding ColGroupes}" Value="{Binding ParametresEtat/fldString1, Mode=OneWay}" HorizontalAlignment="Left" Margin="12,48,0,0" Width="155" Height="19.555" VerticalAlignment="Top" Name="cbGroupe"> <igEditors:XamComboEditor.ComboBoxStyle> <Style TargetType="{x:Type ComboBox}"> <Setter Property="IsSynchronizedWithCurrentItem" Value="true"/> </Style> </igEditors:XamComboEditor.ComboBoxStyle></igEditors:XamComboEditor>
Please do you have any suggestion ?
Thanks
When you set a Binding for a property value as you have, WPF stores that as the local value. When something changes the value of that property (e.g. control needs to set it when you select an item, type into the edit, etc.) then WPF will use that as the new local value replacing the binding that you have set. WPF treats a two way binding specially and maintains the binding and pushes the value back into the source object. This would happen for any wpf property where the object needs to set the value of its property - e.g. the Text property of a TextBox.
Just so I understand what you are trying to accomplish, you want to have the initial value come from your source, you never want changes in the control to be pushed back into your source object but the control is modifiable by the end user, and you want the Value of the control to update if the source property value changes later? So you will either need to use a two way binding, hook the ValueChanged and programatically push the value back into the source, or perhaps write your own attached property and have that programatically push changes into the Value property.
Hi Andrew,
I just ran into the same Issue as mentioned above. I am surprised, you named it a general WPF problem/feature.
Andrew Smith"] This would happen for any wpf property where the object needs to set the value of its property - e.g. the Text property of a TextBox.
This would happen for any wpf property where the object needs to set the value of its property - e.g. the Text property of a TextBox.
The Textbox.Text-property is working fine with OneWay-Binding and user-edits. I just checked that, before consulting the infragistics-forum. So it seems to me, that this is an infragistics-only issue (at least today - not sure about two years ago).
Anyway, could you give an example on any of the two solutions you suggested. I am a bit troubled on either of them.
Regards,
Thank you for your post. I have been looking into it, but it seem like I am missing something about it, so if this is still an issue for you, could you please send me an isolated sample project, where this is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Hi Stefan,
The attachment shows a XamComboEditor, a XamTextEditor and a TextBox and how they can (not) work with OneWay-Binding and User-Edits.
I have logged this with development under ID: 100047 and I have also created a support ticket on your behalf: CAS-82553-0XFMPF and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://es.infragistics.com/Membership/MySupport.aspx
I have been looking into your sample project and I tested it with .Net framework 3.5 and there both the XamTextEditor and TextBox stoped updating after the I changed their Text through the UI. I can say that this functionality has been added in .Net Framework 4 and this is why now TextBox acts like this and because our controls are built in version 3.5 they have that behavior, so I contacted our Dev team and I will update you as soon as I get reply by them.