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

filters in a GridComboBoxColumn

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
m
Top achievements
Rank 1
m asked on 17 Nov 2017, 03:44 AM
I have a GridComboBoxColumn and would like to do searches according to what is being written, right now I have it with a datasource by code, but it is not enabled for it to be written and filtered, now I digit a letter and find the first coincidence, I would like it to search for me the whole text chain what I type, not just the beginning, I would like it to be more interactive, and to be editable, not just selectable. Does anyone know how?
Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Nov 2017, 08:34 AM
Hello,

Thank you for writing.  

The GridViewComboBoxColumn.FilterMode property has two values and determines whether the column will be filtered according to the DisplayMember or the ValueMember. As to the autocomplete functionality you can search the entered text to be contained in the item's text, not the item's text to start with the entered pattern. For this purpose it is necessary to handle the CellEditorInitialized event as follows:
private void RadForm1_Load(object sender, EventArgs e)
{
    this.productsTableAdapter.Fill(this.nwindDataSet.Products);
    this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);
 
    this.radGridView1.DataSource = this.productsBindingSource;
     
    GridViewComboBoxColumn customerColumn = new GridViewComboBoxColumn("Categories");
    customerColumn.DataSource = this.categoriesBindingSource;
    customerColumn.ValueMember = "CategoryID";
    customerColumn.DisplayMember = "CategoryName";
    customerColumn.FieldName = "CategoryID";
    this.radGridView1.Columns.Add(customerColumn);
 
    this.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
}
 
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
    if (editor != null)
    {
        RadDropDownListEditorElement el = editor.EditorElement as RadDropDownListEditorElement;
        el.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
        el.AutoCompleteMode = AutoCompleteMode.Suggest;
        el.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
    }
}

Off topic, if you have any further questions, I would kindly ask you to submit a support ticket where the Telerik support will gladly assist you.

I hope this information helps. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
m
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or