filters in a GridComboBoxColumn

2 posts, 0 answers
  1. m
    m avatar
    3 posts
    Member since:
    Oct 2017

    Posted 16 Nov Link to this post

    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
  2. Dess
    Admin
    Dess avatar
    2222 posts

    Posted 21 Nov Link to this post

    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.
Back to Top