All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

EditFormUserControl Class

Represents a custom Edit Form for the Tree List control.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll

Declaration

public class EditFormUserControl :
    XtraUserControl,
    IExtenderProvider,
    IEditorFormTagProvider
Public Class EditFormUserControl
    Inherits XtraUserControl
    Implements IExtenderProvider,
               IEditorFormTagProvider

Remarks

You can allow users to edit cell values in the Edit Form instead of In-place Editors. The Tree List automatically creates a default Edit Form based on data fields. You can also use a custom user control instead of the default Edit Form.

The EditFormUserControl class serves as a base class for a custom Edit Form. Use the SetBoundFieldName method to bind an editor on the Edit Form to a data source field. Use the SetBoundPropertyName method to specify the editor property that is bound to the data source field. If the property name is not specified, the data source field is bound to the Control.Text or BaseEdit.EditValue property depending on the editor type.

The following code shows how to create the Edit Form shown in the figure above.

using DevExpress.XtraEditors;
using DevExpress.XtraTreeList;

treeList.OptionsBehavior.EditingMode = TreeListEditingMode.EditForm;
// Create a custom EditForm
var control = new EditFormUserControl();
control.Height = treeList.Height / 2;
// Add editors
MemoEdit memoEditNotes = new MemoEdit();
memoEditNotes.Dock = DockStyle.Fill;
TextEdit textEditName = new TextEdit();
textEditName.Dock = DockStyle.Top;
TextEdit textEditType = new TextEdit();
textEditType.Dock = DockStyle.Top;
DateEdit dateEditDate = new DateEdit();
dateEditDate.Dock = DockStyle.Bottom;
control.Controls.Add(memoEditNotes);
control.Controls.Add(dateEditDate);
control.Controls.Add(textEditType);
control.Controls.Add(textEditName);
// Bind the editors to data source fields
control.SetBoundFieldName(memoEditNotes, "Notes");
control.SetBoundFieldName(textEditName, "Name");
control.SetBoundFieldName(textEditType, "TypeOfObject");
control.SetBoundFieldName(dateEditDate, "RecordDate");
// Assign the Edit Form to the Tree List
treeList.OptionsEditForm.CustomEditFormLayout = control;
NOTE

Run the XtraTreeList demo for the complete example.

See Also