【发布时间】:2013-06-24 05:28:35
【问题描述】:
我必须为ultragrid 的单元格值格式化一些datatypes。我使用DateTimeEditor 来格式化datetime 值。
//代码
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
{
if (e.ReInitialize == false)
{
DefaultEditorOwnerSettings editorSettings;
DateTimeEditor datetime_editor;
string condition = e.Row.GetCellValue("Condition").ToString();
switch (condition)
{
case "TEST1":
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;
break;
case "TEST2":
editorSettings = new DefaultEditorOwnerSettings()
editorSettings.DataType = typeof(DateTime);
editorSettings.MaskInput = "hh:mm:ss";
datetime_editor = new DateTimeEditor(new DefaultEditorOwner(editorSettings));
e.Row.Cells["DateInfo"].Editor = datetime_editor;
break;
}
}
}
现在,如何格式化 currency 和 decimal 值?
有currencyeditor或decimaleditor吗?
【问题讨论】:
标签: vb.net formatting infragistics ultrawingrid