I'm really sorry if my problem was discussed already. But i did not found an answer.
I have ultragrid which is bound to DataTable. One of the columns should support masked input, this datacolunm is type of string.
Entered data should have format "aaaaa/aa.aaaa", where 'a' is alphanumeric.
Here is short code example.
column.EditorComponent = new UltraMaskedEdit() { InputMask = "aaaaa\\/aa\\.aaaa", DisplayMode = MaskMode.IncludeBoth, ClipMode = MaskMode.IncludeBoth };
When the cell is in edit mode mask is shown. When the cell is not active - data are shown without mask. I've tried to set column.Format to "aaaaa\\/aa\\.aaaa", but unsuccessful.
If I do not set EditorComponent, but use column.MaskInput instead, then data from cell are stored with mask into DataTable.
Setting column.MaskDataMode to MaskMode.Raw has np effect.
Please help me to show my data with mask :)
Hi,
I tried out your code and it works fine for me. I have attached my sample here so you can try it out.
Below is the code snippet for the same which i have written:
var
editorColumn = _controlSelectedValues.DisplayLayout.Bands[0].Columns["Value"];
editorColumn.EditorComponent =
new UltraDateTimeEditor
{
FormatProvider =
new System.Globalization.CultureInfo("fr-FR"),
FormatString =
"dd/MM/yyyy hh:mm:ss",
MaskInput =
"dd/mm/yyyy hh:mm:ss",
Name =
"udteMaxDateValue",
Tag =
"Removable Control",
NullText =
"Select end date",
TabIndex = 8,
Value =
null
};
I am using UltraGrid in my application.
That grid contains only one column called value.
Depeneidng on some criteria , in run time i am setting editor component of the column value.
When i m setting it to DateTime havin mask input, format string evey thing set as
"dd/mm/yyyy hh:mm:ss".
When i am running the application, second section of time is not appearing in the grid cell also its not allowing me to enter more than 12 number i.e. if i try to enter 13 or more than that it's not allowing me to do that.
Please let me know in case some thing specific needs to be done for getting both the above mentioned point done.
Request you to reply at the earliest.
Mike, thank you for you kind help once again.
If you are applying the mask to a cell via an editor or EditorComponent (which is what you would have to do in order to apply a mask to a cell and not a column), then you must set the UseEditorMaskSettings property on the column to true. This tells the cells in that column to ignore the column's mask properties like MaskDisplayMode and use the editor's MaskDisplayMode instead.