windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemcollection-dot-add-x28-system-dot-string-x29.md
Creates a new repository item of the specified type and adds it to the end of the collection.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual RepositoryItem Add(
string editorName
)
Public Overridable Function Add(
editorName As String
) As RepositoryItem
| Name | Type | Description |
|---|---|---|
| editorName | String |
A string value specifying the repository item type by the corresponding editor type name.
|
| Type | Description |
|---|---|
| RepositoryItem |
A RepositoryItem descendant representing the new repository item.
|
If the editor type name is specified incorrectly, an exception is raised.
To add a number of repository items at once, use the RepositoryItemCollection.AddRange method.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-bars-create-baredititem/CS/Form1.cs#L138
// create combo
combo = barManager1.RepositoryItems.Add("ComboBoxEdit") as DevExpress.XtraEditors.Repository.RepositoryItemComboBox;
combo.Items.Add("Item A");
winforms-grid-multiple-row-selection-web-style-checkboxes/CS/E1271/CheckMarkSelection.cs#L114
try {
edit = view.GridControl.RepositoryItems.Add("CheckEdit") as RepositoryItemCheckEdit;
winforms-lookup-display-custom-text-for-not-found-edit-value/CS/Form1.cs#L31
RepositoryItemLookUpEdit editor = gridControl1.RepositoryItems.Add("LookUpEdit") as RepositoryItemLookUpEdit;
editor.DataSource = tblLookUp;
winforms-grid-display-icons-in-data-cells/VB/Form1.vb#L158
AddHandler gridView1.CustomUnboundColumnData, AddressOf GridView1_CustomUnboundColumnData
Dim checkEdit As RepositoryItemCheckEdit = TryCast(gridControl1.RepositoryItems.Add("CheckEdit"), RepositoryItemCheckEdit)
checkEdit.PictureChecked = GetImageFromResource("Image0")
winforms-bars-create-baredititem/VB/Form1.vb#L133
' create combo
combo = TryCast(barManager1.RepositoryItems.Add("ComboBoxEdit"), DevExpress.XtraEditors.Repository.RepositoryItemComboBox)
combo.Items.Add("Item A")
winforms-grid-visualize-master-detail-data/VB/Form1.vb#L44
'Present data in the Picture column as Images
Dim riPictureEdit As RepositoryItemPictureEdit = TryCast(gridControl1.RepositoryItems.Add("PictureEdit"), RepositoryItemPictureEdit)
gridView1.Columns("Picture").ColumnEdit = riPictureEdit
winforms-grid-multiple-row-selection-web-style-checkboxes/VB/E1271/CheckMarkSelection.vb#L144
Try
edit = TryCast(view.GridControl.RepositoryItems.Add("CheckEdit"), RepositoryItemCheckEdit)
column = view.Columns.Add()
winforms-lookup-display-custom-text-for-not-found-edit-value/VB/Form1.vb#L32
gridControl1.DataSource = tblGrid
Dim editor As RepositoryItemLookUpEdit = TryCast(gridControl1.RepositoryItems.Add("LookUpEdit"), RepositoryItemLookUpEdit)
editor.DataSource = tblLookUp
See Also
RepositoryItemCollection Class