This is a migrated thread and some comments may be shown as answers.

skipping first letter in search of combo box column

1 Answer 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 11 Apr 2013, 06:29 PM
I need this in both grid combo box columns and the radcombo itself.
when set to dropdownlist, is there a way to skip the first letter in the combo when the combo auto selects something?

I have the following in a combo


D123
D125
D101

the users don't want to have to type the d, but want it in the combo.  they want to type 10 and have it pick D101 etc.

thanks.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Apr 2013, 11:59 AM
Hello John,

Thank you for writing.

While there is no way to skip the first letter, you can cover your case by using the Contains mode of the AutoCompleteSuggest functionality. To set it for the combo in the grid, you have to use the CellEditorInitialized event:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (e.Column.Name == "ComboColumn")
    {
        RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
        if (editor != null)
        {
            RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;
            element.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
        }
    }
}

To do that for the control, please consider the following property:
radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;

I hope that you find this useful.

Kind regards,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or