All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
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.

GridLookUpEdit.AutoSuggestComplete Event

Fires after the GridLookUpEdit.AutoSuggest event is finished, and allows you to additionally customize the editor.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraGrid.v21.1.dll

Declaration

[DXCategory("Events")]
public event LookUpEditAutoSuggestCompleteEventHandler AutoSuggestComplete

Event Data

The AutoSuggestComplete event's data class is DevExpress.XtraEditors.Controls.LookUpEditAutoSuggestCompleteEventArgs.

Remarks

The code below focuses a suggestion in a drop-down list if this is the only suggestion found. As a result, a user can click Tab or Enter to select this suggestion, without having to press the Down arrow first.

private void AutoSuggestCompleteHandler(object sender, LookUpEditAutoSuggestCompleteEventArgs e) {
    var edit = (GridLookUpEdit)sender;
    if (e.QuerySuggestions.Result.Count == 1) {
        var popup = edit.GetPopupEditForm();
        popup.SelectedIndex = 1;
    }
}

The following sample dynamically changes the drop-down panel height, depending on how many suggestions it shows.

void LookUpEdit1_AutoSuggestComplete(object sender, DevExpress.XtraEditors.Controls.LookUpEditAutoSuggestCompleteEventArgs e) {
    var form = ((GridLookUpEdit)sender).GetPopupEditForm();
    int recordCount = e.QuerySuggestions.Result.Count;
    if(recordCount < "10") {
    form.Size = new System.Drawing.Size(form.Width, recordCount*25);
    }
}
See Also