Skip to main content
A newer version of this page is available.
All docs
V18.2

EditFormPreparedEventArgs.BindableControls Property

Provides access to the collection of controls used to edit fields of the processed data record, which are indexed by field names or grid columns.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v18.2.dll

Declaration

public EditFormBindableControlsCollection BindableControls { get; }

Property Value

Type Description
DevExpress.XtraGrid.EditForm.Helpers.EditFormBindableControlsCollection

The collection of controls representing editors in the Edit Form.

Remarks

To retrieve an editor for a particular field/column from the collection, use the corresponding data field name (see GridColumn.FieldName), or the corresponding GridColumn object.


private void gridView1_EditFormPrepared(object sender, DevExpress.XtraGrid.Views.Grid.EditFormPreparedEventArgs e) {
    Control colCityEditor = e.BindableControls[colCity];
    Control colAddressEditor = e.BindableControls["Address"];
    //..
}

Example

When the Edit Form is displayed, focus moves to the first editor within the Edit Form. The following example shows how to handle the GridView.EditFormPrepared event to set focus to an editor corresponding to the focused GridColumn.

public partial class Form1 : Form {
    public Form1() {
        InitializeComponent();
        gridView1.EditFormPrepared += gridView1_EditFormPrepared;
    }

    private void gridView1_EditFormPrepared(object sender, DevExpress.XtraGrid.Views.Grid.EditFormPreparedEventArgs e) {
        GridView view = sender as GridView;
        if (e.BindableControls[view.FocusedColumn] != null)
            e.FocusField(view.FocusedColumn);
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BindableControls property.

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.

See Also