I have an EditorWithMask that I am using with a date column. We are using a specific date value to mean no date has been set. When the cell holds this value I would like to display it as an empty cell. I also have a requirement to place "N/A" in the field when certian conditions based on other cells in the row are met. Is there an easy way to programmatically replace the formated value the grid would ordinarily display with custom text?
Another approach I attempted was to use an EditorWithText with a style set to DateWithoutDropDown in conjuction with a datafiler for my custom formatting, but I was not able to get the masking to behave as nicely as the EditorWithMask. I also get a runtime error that appears to be internal to the editor when someone enters a value then backspaces past the beginning of the cell.
I think that your best bet would be to use a DataFilter to show what you want. You can find an example of a data filter in the KB.
-Matt
I tried it with the EditorWithMask, but it seems to have no effect on what is displayed in the EditorWithMask. It works fine with the EditorWithText, but that has its own issues that I discribed in the original post. I need another idea...or more specifics on changes to the DataFilter that are necessary when working with the EditorWithMask.
I was able to get some of the functionality I needed by making a new class that inherits from EditorWithMask and overriding the GetAutoConvertedDestinationValue function. If I convert our minimum date to nothing when the direction is OwnerToEditor I can "blank out" the date. I also need to reverse the procedure when the direction is EditorToOwner.
I have not found a workable solution yet to display "N/A" when the date is not applicable. Any assistance here would be appreciated.
Here it is...
Apparently I glossed over the part where you said you tried a DataFilter. I don't know of any specific changes that need to be made specific to the EditorWithMask. Can you post the DataFilter that you've tried already?