Change GridViewComboBoxColumn filtering type

9 posts, 0 answers
  1. Fadi
    Fadi avatar
    20 posts
    Member since:
    Oct 2012

    Posted 16 Jan 2013 Link to this post

    I have a telerik GridView contains ComboBoxcolumn, the filtering type when i search inside the Combobox Column is 'StartWith'. and I want to change it to 'Contains'. How could i do it?
  2. Jeff
    Jeff avatar
    62 posts
    Member since:
    Apr 2012

    Posted 16 Jan 2013 Link to this post

    You can filter the bindingsource for that column. I do it like this:
    TableBindingSource.Filter = "MyColumn = SomeValue"

    Sometimes I bind a combobox to a DateView and those can be filtered and sorted just as easily.
    Dim DV1 As DataView = New DataView(DataSet.MyTable)
    DV1.Sort = "LookupName"
    DV1.RowFilter = "ZipCode = 32401"
    With ComboBox1
        .DataSource = DV1
        .DisplayMember = "LookupName"
        .ValueMember = "ID"
    End With
  3. Fadi
    Fadi avatar
    20 posts
    Member since:
    Oct 2012

    Posted 16 Jan 2013 Link to this post

    Thanks permalink. And i do usually do the bindingsource.filter. But now i am using GridViewComboboxColumn. And i am filterimg it, but i meed the filter type. Or filter operator to be 'Contains' nit 'StartWith'.
  4. Jeff
    Jeff avatar
    62 posts
    Member since:
    Apr 2012

    Posted 16 Jan 2013 Link to this post

    Sorry if I'm misunderstanding you, but it sounds like you're looking for something similar to this:
    TableBindingSource.Filter = "MyColumn Like %SomeValue%"
  5. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 17 Jan 2013 Link to this post

    Hi guys,

    Thank you for writing.

    The RadGridView control includes FilterDescriptors property of the GridViewTemplate which is exposed in RadGridView class for the MasterTemplate instance. This collection stores filter descriptors used for filtering operation. The FilterDescriptor class implements filtering property (field) name, filtering operator and value, which is used to define simple filtering expressions. The Operator property allows you to define the type of operator. In your case, you can add "StartsWith" filter to a specific column by adding a FilterDescriptor:
    this.radGridView1.EnableFiltering = true;
     
    FilterDescriptor filterProductName = new FilterDescriptor();
    filterProductName.PropertyName = "Phone";
    filterProductName.Operator = FilterOperator.StartsWith;
    filterProductName.Value = "M";
    filterProductName.IsFilterEditor = true;
    this.radGridView1.FilterDescriptors.Add(filterProductName);

    In addition, you could read our documentation article about setting filters programmatically (simple descriptors): http://www.telerik.com/help/winforms/gridview-filtering-setting-filters-programmatically-simple-descriptors.html.

    Attached you can find a sample project.

    I hope this helps.

    Regards,
    Plamen
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  6. Fadi
    Fadi avatar
    20 posts
    Member since:
    Oct 2012

    Posted 18 Jan 2013 Link to this post

    Thanks Plamen for writing, but u seem like misunderstood me. What do i want is to search inside a GridViewComBoxColumn. Same as the below link image...
    IMAGE
    I did it but the fltering type is 'StartWith'
    So i want to write inside this GridViewComboBoxColum and filter with 'Contains' not 'StartWith'
    Thanks in advance.
  7. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 23 Jan 2013 Link to this post

    Hello Fadi,

    Thank you for writing.

    In this case I can offer setting the DropDownStyle of the editor in the filter row to DropDown, so it will allow typing in it, add a FilterDescriptor for this column and then in the TextChanged of the same editor set the value the FilterDescriptor.

    Attached you can find a sample application, which I hope will help you.

    Kind regards,
    Plamen
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  8. h
    h avatar
    3 posts
    Member since:
    Nov 2016

    Posted 18 Nov 2017 in reply to Plamen Link to this post

    Hi, what am I doing wrong, I just added that the control was editable, the problem I have is that when I open the options and start typing to filter, I get two filters, which do not filter at the same time, I would like only one to come out and be bigger than the column that has the ComboBox thanks in advance
  9. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4086 posts

    Posted 21 Nov 2017 Link to this post

    Hello, 

    Thank you for writing.  

    It is a known issue RadDropDownList. You can track its progress, subscribe for status changes and add your comments on the following link: https://feedback.telerik.com/Project/154/Feedback/Details/169297-fix-raddropdownlist-the-control-popup-is-not-closed-automatically-when-the-aut

    Feel free to use the suggested solution in the feedback item to close the drop down when the autocomplete popup is shown.

    I hope this information helps. Should you have further questions I would be glad to help.
     
    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