我正在尝试格式化Ultragridcell
使用下面的代码,它工作正常。
//Code
DefaultEditorOwnerSettings editorSettings;
DateTimeEditor datetime_editor;
editorSettings = new DefaultEditorOwnerSettings()
editorSettings.DataType = typeof(DateTime);
editorSettings.MaskInput = "mm/dd/yyyy";
datetime_editor = new DateTimeEditor(new DefaultEditorOwner(editorSettings));
e.Row.Cells["DateInfo"].Editor = datetime_editor;
但当我尝试format
就像下面的代码一样,它失败了。
//Code
DefaultEditorOwnerSettings editorSettings;
DateTimeEditor datetime_editor;
editorSettings = new DefaultEditorOwnerSettings()
editorSettings.DataType = typeof(DateTime);
editorSettings.MaskInput = "D";
datetime_editor = new DateTimeEditor(new DefaultEditorOwner(editorSettings));
e.Row.Cells["DateInfo"].Editor = datetime_editor;
难道只有这个custom formatting
也只有有限的类型适用于细胞,或者我在某个地方错了。
需要对此的建议。
看来您认为 MaskInput 属性支持由复合格式,但我不认为这是真的。
MaskInput 可用的格式据我所知仅限于由UltraGrid Designer
.
使用UltraGrid Designer
(右键单击UltraGrid控件,选择UltraGrid Designer)单击Data Schema
并定义一个数据架构,其中其中一列将是日期时间列。然后前往Bands and Column Settings
节点,选择列,然后选择定义为 DateTime 的列。在属性窗口中,您可以找到 MaskInput 属性及其允许的值。您可以尝试使用预定义的掩码进行试验,并检查是否有适合您的要求的掩码。
正如我所说,这就是我认为的事实。我不知道是否有另一种高级模式可以在设计时或运行时设置这些属性。如果来自 Infragistics 的人想在这个答案中添加一些内容,我们将受到欢迎
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)