0
votes

How to detect end user has changed value in cellvaluechanged devexpress gridview?

As described here :

The CellValueChanged event fires when:

1- a user has changed the in-place editor's value and now closes this editor. 2- the SetRowCellValue method or other Grid API was used to change a cell value in code.

I need to detect when a user has changed the in-place editor's value and now closes this editor.

1

1 Answers

1
votes

GridView.ShownEditor event can be used to detect editor's changings.

Example:

    private void gridView1_ShownEditor(object sender, EventArgs e)
    {
        GridView view = sender as GridView;
        if (view.ActiveEditor is DevExpress.XtraEditors.TextEdit)
        {
            view.ActiveEditor.EditValueChanged += ActiveEditor_EditValueChanged;
            view.ActiveEditor.Leave += ActiveEditor_Leave;
        }
    }

    void ActiveEditor_EditValueChanged(object sender, EventArgs e)
    {

    }

    void ActiveEditor_Leave(object sender, EventArgs e)
    {

    }