I've got a TimeSpan property that I want to edit in an UltraGridCell. I've got the EditorDataFilter code so that it works in a kind of "natural language" manner (e.g., 1d 3h 2m for 1 day, 3 hours, and 2 minutes). That part works great. What doesn't work is that I've specified a mask that requires the user to enter the text into the cell in that format, but the mask isn't doing anything at all. I have other scenarios with both Framework types and custom types that I need this kind of support for. What should I do?
I'm using EditorWithText:
Dim column As Infragistics.Win.UltraWinGrid.UltraGridColumn = _ Me.ParentBand.Columns("Duration") column.Hidden = False column.Header.VisiblePosition = ColumnDisplayOrder.Duration
Dim durationEditor As New Infragistics.Win.EditorWithText durationEditor.DataFilter = New CustomTimespanDataFilter column.Editor = durationEditor
column.MaskInput = "0#d 0#h 0#m"
I tried using the EditorWithMask, but it just completely blew up. Apparently it's coded only to recognize specific types, and woe unto you if you need to control the formatting of a custom type. Is there some editor or combination of components I can use to achieve this functionality? Could I embed a standard .NET Control such as the Masked Edit Textbox in the ultragrid or something like that?
Thanks,
Chris
My guess is that the mask doesn't work because the editor you are using for the column doesn't support masking. When you set the properties on a column like Value or MaskInput, the grid automatically chooses the appropriate editor to provide those features. If you set MaskInput and then assign an editor on the column like an UltraTextEditor, then it won't be able to support a mask.