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

Combobox GridView Column

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Simeon
Top achievements
Rank 1
Simeon asked on 11 Apr 2012, 01:45 PM
Hi,
Congrats on your lovely gridview control.
That is exactly what many people needed and i'm sure that you will continuing with many new features.
In my view it will be great to implement the full combobox functionality  on the gridview column. I mean the filtering and autocomplete functionality as well. May be there is a way but i can not find it, so please let me know.
Regards,
Simeon

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 16 Apr 2012, 01:28 PM
Hi Simeon,

Thank you for writing.

Both of the desired functionalities are supported by the RadDropDownListEditor in RadGridView. In order to enable the auto complete functionality, you need to set the DropDownStyle to DropDown and also to set the desired AutoCompleteMode:
comboColumn.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
comboColumn.AutoCompleteMode = AutoCompleteMode.SuggestAppend;

In regards to the filtering of the drop down list, this can be achieved by setting the Filter property of RadDropDownListEditorElement. You can access this element of the editor in the CellEditorInitialized event of RadGridView:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
    if (editor != null)
    {
        RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement;
        element.Filter = FilterMethod;
    }
}
 
private bool FilterMethod(RadListDataItem itemToFilter)
{
    return itemToFilter.Text.ToLower().Contains("b");
}

I hope that the provided information addresses your question. Should you have any other questions, do not hesitate to contact us.
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Simeon
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or