Hello,
I am currently using the UltraCurrencyEditor and have run across a case where we need a special 'All' value. Preferable 'All' would be the 'null' value's text representing whenever the user completely clears the editor (mainly this is a default value and won't be entered manually). I've searched through the editors properties and have not found anything that does what I am hoping for (Version 7.3.20073.1052) . Is there a simple way to do this that I am missing or is this a fairly complicated process? Thanks,
Jason
Hi Jason,
Does the UltraCurrencyEditor control have a NullText or NullTextLabel proprety? If so, that would be the easiest way to display some meaningful text (such as "All") when the value of the control is null (or DBNull).
If there is no such property, then then alternative would be to use a DataFilter.
Thanks for your reply.
That's the sort of property I was hoping for, but the UltraCurrencyEditor has neither "NullText" nor a "NullTextLabel" property. I also do not see anything exposing or accepting a DataFilter on the editor. It appears I would have to cast the UltraCurrencyEditor to an EmbeddableEditorBase to get any access to a DataFilter, but the CurrencyEditor does not implement EmbeddableEditorBase. Are there any other alternatives?
This code you have here will not do anything at all, because you are never setting conversionArgs.Handled to true.
Is the EditorToDisplay conversion ever being called? It's possible that you are right and that the reason for this is that the masked editors never call this conversion.
I think you've nailed it on the head. I changed my code to....
public object Convert( EditorDataFilterConvertArgs conversionArgs ) { if( conversionArgs.Direction == ConversionDirection.EditorToDisplay ) { conversionArgs.Handled = true; return conversionArgs.Value ?? NullText; } return conversionArgs.Value; }
Then debugged through this and never entered the if statement. The flow appears to go DisplayToEditor, then EditorToOwner, and finally OwnerToEditor. The EditorToDisplay never gets executed. Thanks again for all of your time and help, I'll begin researching other work-arounds.
I guess the EditorToDisplay conversion isn't allowed because you might pass back some text that doesn't fit the mask and the control would not be able to handle that.
In that case, I would recommend a DrawFilter. That way you can draw the text yourself and you have total control over it.
In the helpfiles in the 'about' page of the WinCurrencyEditor is stated that it should support a Null Text - Is this now the case? and if so, from which version and how to use...
I'm not sure exactly what 'about' page you are referring to. But there is no NullText property on the UltraCurrencyEditor.
I already figured that out and replaced the control by the UltraMaskedEdit control.
In the helpfile the Nulltext is mentioned though on the Currency editor: ms-help://MS.VSCC.v90/INFRAGISTICS_NETEN82CLR2_HELP/NetAdvantage_NETEN82CLR2/Win_NETEN82CLR2/WinElements/WinCurrencyEditor_About_WinCurrencyEditor.html
This is in the menu "Windows Forms | Developer's Guide | The Toolset | WinCurrency editor" and than click on "About WinCurrencyEditor"
I'm using the 2008 Vol 2 edition...