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
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 did find the DataFilter property on the control (not sure how I missed it before..) so I setup a custom data filter and implemented the Convert method like the following:
public object Convert( EditorDataFilterConvertArgs conversionArgs ) { return conversionArgs.Value ?? NullText; }
( Yes, I am ignoring the ConversionDirection in this example. I initially put the above statement in an ' if( args.ConversionDirection == EditorToDisplay', then tried 'EditorToOwner', then tried each of the other possible values, but none of them made any difference. )
This sets the ValueObject on the CurrencyEditor, but the Value property is still set to an 'empty' decimal value. Apparently when the control 'gets' it's display value it goes directly to the Value property reguardless of what the ValueObject is set to. I guess I will have to make a custom control that swaps the CurrencyEditor out with a TextBox to display the 'null-text' when that situation occurs unless I have glossed over something obvious. Thanks a bunch for your time and help!
jason
Hi Jason,
Hm, there's no NullTextLabel, I see. You should Submit a feature request to Infragistics for that. Perhaps it can be added in a future release.
There is certainly a DataFilter proprety right on the control, though. Not sure why you are not seeing it, unless maybe you have a really old version from before DataFilters were added. But if that were the case, you would not be seeing the property on EmbeddableEditorBase. Are you sure you are looking at the right control?
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?
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.