Using an XamTextEditor i'm not able to show an altered value while in edit mode.Having business code in my business object i cannot reflect the changes to the XamTextEditor, when i replace the XamEditor for a default TextEditor everything works fine.See an examplehttp://social.msdn.microsoft.com/forums/en-US/wpf/thread/6f78d75f-9769-4ff9-a76f-c2af0040d9b0/Doesn't work:<igEditors:XamTextEditor Text="{Binding Path=Naam, Converter={conv:DBNullToEmptyConverter}}" />Works:<TextBox Text="{Binding Path=Naam, Converter={conv:DBNullToEmptyConverter}}" />
Hello,
Just noticed your post from last year. Sorry it wasn't answered. We received a huge influx of posts last year and we are going through addressing everything that was missed!
Is this something that you were able to resolve? If not, are you saying that if an editor is in edit mode and if the underlying data is changed that the editor does not update until you exit edit mode?
Thank you!
"if an editor is in edit mode and if the underlying data is changed that the editor does not update until you exit edit mode"
This is behaviour that I actually want. How do I do this?
Sorry about assuming you were using the data grid.
IEditableObject should still work with the editor.
This issue does not apply to XamDataGrid in any way whatsoever - this is purely to do with XamTextEditor, or more specifically in my case, XamNumericEditor (don't think that makes a difference, though).
Following your usability request...
If the user hits enter or tab after editing text, then the modified value should be ignored and the user value is applied.
If the user hits cancel, then the model modified data is applied as soon as the cell exits edit mode. The change may be odd to the user.
Are you finding that the cell value is changing as soon as the model changes the data regardless whether the cell is in edit mode or not? And the solution you are looking for is to prevent the cell from getting the new data when in edit mode.
You can keep track of whether a value is being edited by implementing IEditableObject on your ViewModel (the data bound to the XamDataGrid). Then you can prevent the value from changing while in edit mode.
For more information about how to use IEditableObject, check out the following web pages:
http://blogs.infragistics.com/blogs/josh_smith/archive/2008/05/08/creating-objects-that-support-edit-cancellation-via-ieditableobject.aspx
http://forums.infragistics.com/forums/p/2164/14539.aspx
The behaviour I'm looking for is as follows:
If the editor is in edit mode and the underlying data model modifies the bound value (Value property), then the displayed text in the editor does not change to the new value (so that any value that the user is in the middle of typing does not suddenly get lost).
Everything else should be as normal - when edit mode is exited (depending on UpdateSourceTrigger of course), the underlying value is written to. Our model is written such that no further target updates will occur once the user has committed a manual edit.
Thanks,
Jason
To clarify, if an editor is in edit mode, and the underlying data model modifies the bound value, you don't want the control to update until the user exits edit mode? It seems like you would need to never change the value while in edit mode, because the user is editing the value. Either the user's edit will be lost (whether you update the value during or after edit mode) or the underlying value change will be overwritten.
What exactly is the behavior you are looking for?
Thanks!