C1 ComboBox Column search bar in filter

Posted by: ydolapchiev on 24 February 2021, 3:00 am EST

  • Posted 24 February 2021, 3:00 am EST

    Hello,
    I am looking for a way to add a search bar text box in the filter dropdown of a combobox column. For example if I have 1000 different possible values in that combobox column and want to filter to see only 5 of them, I want to be able to search for them by their name, instead of scrolling through 1000 entries with chance to miss one.
  • Marked as Answer

    Replied 24 February 2021, 10:22 pm EST

    Hi Yordan,

    You can override the DataGridComboBoxColumn's GetFilter method and provide the modified DataGridFilter as follows:

    public class DataGridComboBoxColumnEx : C1.WPF.DataGrid.DataGridComboBoxColumn
    {
    public override IDataGridFilter GetFilter()
    {
    var filter = base.GetFilter();
    (filter as DataGridFilter).InnerControl = new DataGridMultiValueFilterEx()
    {
    ItemsSource = ItemsSource
    };
    return filter;
    }
    }

    Please refer to the attached sample for full implementation. (see DataGridFilterSearch.zip)

    Best Regards,
    Kartik

    DataGridFilterSearch.zip
  • Replied 7 March 2021, 11:28 pm EST

    Thank you!
    This is exactly what I needed.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels