我有簡單的問題DevExpress LookUpEdit DisplayFormat。我想實現在lookUpEdit結果一樣:
文檔類型(.DOC)
文檔類型(的.docx)LookUpEdit DisplayFormat格式字符串
const string defaultExtensionsList = "doc;docx;xlsx;xls;pdf;txt";
//...
var column = new LookUpColumnInfo("Column", "Extensions")
{
Visible = true,
//FormatType = FormatType.Custom,
//FormatString ="Document type (*.{0})",
Alignment = HorzAlignment.Near
};
ExtensionsLookup.Properties.DisplayFormat.FormatType = FormatType.Custom;
ExtensionsLookup.Properties.DisplayFormat.FormatString = "Document type (*.{0})";
ExtensionsLookup.Properties.EditFormat.FormatType = FormatType.Custom;
ExtensionsLookup.Properties.EditFormat.FormatString = "Document type (*.{0})";
ExtensionsLookup.Properties.Columns.Add(column);
var bindingList = defaultExtensionsList.Split(';').ToList();
ExtensionsLookup.Properties.DataSource = bindingList;
hank。這幾乎是我所需要的。 var columnToDisplay = new LookUpColumnInfo(「Display」,「Extensions」); ExtensionsLookup.Properties.Columns.Add(columnToDisplay); ExtensionsLookup.Properties.GetNotInListValue + = OnGetNotInListValue;爲什麼幾乎? EditValue未格式化:)我將接受:P. – kayz1 2012-02-13 19:20:43