Tim
Tim

Reputation: 8921

Get editor's OldValue from DevExpress RepositoryItemGridLookUpEdit in EditValueChanged event

I'm using the classic WinForms version of the DevExpress XtraEditors. The WPF version makes it easy to get the editor's old value in the EditValueChanged event, but I don't see how to get the old value in the WinForms counterpart EditValueChanged event. If it can be obtained from within that event, how to do it?

https://documentation.devexpress.com/#windowsforms/DevExpressXtraEditorsRepositoryRepositoryItem_EditValueChangedtopic

Upvotes: 1

Views: 1957

Answers (1)

nempoBu4
nempoBu4

Reputation: 6621

RepositoryItemGridLookUpEdit class is not an editor itself. This class is only holding properties for in-place editors. So, to get editor's old value you must get the editor itself (from sender object) and use its BaseEdit.OldEditValue property.
Here is example:

private void repositoryItemGridLookUpEdit1_EditValueChanged(object sender, EventArgs e)
{
    var baseEdit = (BaseEdit)sender;

    if (baseEdit.OldEditValue.ToString() == "Some value")
    {
        //...
    }
}

Upvotes: 1

Related Questions