下面的示例演示了如何创建和调整一个新的编辑器。 通过 TreeListColumn.ColumnEdit 属性,此编辑器被绑定到“ShipCity”列。

下面的屏幕截图展示了代码的执行结果。

C#CopyCode image复制代码
using DevExpress.XtraEditors.Repository;

//Create a repository item which corresponds to a combo box editor.
RepositoryItemComboBox riCombo = new RepositoryItemComboBox();
riCombo.Items.AddRange(new string[] {"London", "Berlin", "Paris"});
//Add the item to the internal repository
treeList1.RepositoryItems.Add(riCombo);
//Now you can define the repository item as an in-place column editor
colShipCity.ColumnEdit =  riCombo;

Visual BasicCopyCode image复制代码
Imports DevExpress.XtraEditors.Repository
' ...
'Create a repository item which corresponds to a combo box editor.
Dim riCombo As RepositoryItemComboBox = New RepositoryItemComboBox
riCombo.Items.AddRange(New String() {"London", "Berlin", "Paris"})
'Add the item to the internal repository
TreeList1.RepositoryItems.Add(riCombo)
'Now you can define the repository item as an in-place column editor
colShipCity.ColumnEdit = riCombo