I'm having some issues getting the XamMaskedEditor Converter to work, and I'm not sure if it's my approach or something I'm missing. I'm trying to get a time format mask and convert that to a timespan (e.g. hh:mm:ss).
In NetAdvantage for WinForms I accomplished this via a DataFilter on my UltraMaskedEdit. I thought I could accomplish the same thing with the XamMaskedEditor and similar ValueToDisplayTextConverter/ValueToTextConverter converters. However, when I set both of these up, XamMaskedEditor doesn't seem to respect the converter in edit mode. DisplayMode appears to work correctly.
Are there any examples out there of something similar? The documentation refers to a similar case here: http://help.infragistics.com/Help/NetAdvantage/WPF/2007.2/CLR3.X/html/xamEditors_Overview_of_the_ValueEditor_Class.html
but I have not been able to find code/examples in the rest of the docs or the feature browser.
Is this the correct approach, or is the appropriate replacement for the DataFilter functionality at the DataBinding instead?
Any help is appreciated. Thanks,
- Micah
Hello Micah,
From your post, it sounds like you have set up the converters correctly. Would you provide me a snippet of code and XAML or a sample project which will demonstrate the approach you are taking. I should be able to take a closer look and determine why the converters are not working as you would expect. If you want to attach a sample project, you are welcome to email me the project directly if you would prefer to keep any of the code confidential.
Thank you,
Curtis,
I've enclosed a test project, for you to see. The steps I'm using to replicate the problem I'm seeing is:
1. Click into the XamMaskedEditor
2. Type in 024, then hit tab to blur the focus. The "Value:" correctly displays 86400, which is 24 hours in seconds. The XamMaskedEditor correctly displays "024:00:00". I've attached xme_1.png as the result.
3. Click into the XamMaskedEditor again. The XamMaskedEditor shows "864:00:00" This is unexpected. I've attached xme_2.png as the result.
Thanks,
Micah Tan
P.S. I just tried attaching the two images, and I can't seem attach multiple files -- I've included them in the zip.
Thanks for the excellent sample!
I (or an engineer) will get back to you with an answer.
Thanks!
Any answer? I've a similar problem... the ValueToDisplayTextConverter works fine, but ValueToTextConverter doesn't work!
Hello,
I apologize, this post was lost in the shuffle of things to do. I have asked an engineer to respond to this post as soon as possible.
Thank you!
Hi,
This is from one of our engineers:
As to whether there’s a bug somewhere in the masked editor, I’m not completely sure however there seems like a bug in the masked editor. However as far as the customer’s sample goes, all he needs to do to make this work the way he wants is to not specify any converters on the editor and instead specify them on the binding object that binds the editor’s value property to the data object. I’ve made the necessary changes in the sample (attached) to get the desired behavior (see attachment).
Please let us know if this helps.
Ok! Thanks! I've tried with the converter of the binding and worked fine! The problem is that in the converter of the binding, the parameter "parameter" doesn't receive the Editor like in the ValueToTextConverter or ValueToDisplayTextConverter. But I can resolve doing a Converter for each ValueType.