Back to Devexpress

Multi Cell Edit Behavior

windowsforms-405624-common-features-behaviors-multi-cell-edit-behavior.md

latest2.3 KB
Original Source

Multi Cell Edit Behavior

  • Nov 26, 2025

Use a MultiCellEditBehavior object to allow a user to edit multiple selected cells simultaneously.

Run Demo: Cell Selection

Supported Controls

Activate Multi-Cell Editing

  1. Activate the control’s OptionsSelection.MultiSelect property.

  2. Drop the BehaviorManager component onto the form.

  3. Select Edit Behaviors in the BehaviorManager’s smart tag menu and add a Multi Cell Edit Behavior in the Behavior Editor.

Code Example

The following code snippet activates multi-cell editing in a GridView:

csharp
using DevExpress.XtraEditors;
public class Form1 : XtraForm {
    BehaviorManager bm;

    public Form1() {
        InitializeComponent();
        // Activate multi-cell selection
        gridView1.OptionsSelection.MultiSelect = true;
        // Attach a Multi Cell Edit Behavior
        bm = new BehaviorManager(this.components);
        bm.Attach<MultiCellEditBehavior>(gridView1);
    }
}
vb
Imports DevExpress.XtraEditors

Public Class Form1
    Inherits XtraForm
    Private bm As BehaviorManager

    Public Sub New()
        InitializeComponent()
        ' Activate multi-cell selection
        gridView1.OptionsSelection.MultiSelect = True
        ' Attach a Multi Cell Edit Behavior
        bm = New BehaviorManager(Me.components)
        bm.Attach(Of MultiCellEditBehavior)(gridView1)
    End Sub
End Class

Notes

  • New values are only applied to cells with compatible value types.
  • If the control’s OptionsSelection.MultiSelectMode is set to RowSelect, new values are only applied to the focused column.