DataGrid Filter Method Very Slow
private void SearchGrid(object sender, TextChangedEventArgs e)
    {
        if (!string.IsNullOrEmpty(searchBox.Text))
        {
            ICollectionView view =      CollectionViewSource.GetDefaultView(dataGrid.ItemsSource);
            view.Filter += (obj) =&gt;
            {
                CompanyModel model = obj as CompanyModel;
                if (model == null)
                    return true;

                if (compNameRad.IsChecked == true)
                {
                    return !string.IsNullOrEmpty(model.CompanyName) &amp;&amp; model.CompanyName.Contains(searchBox.Text);
                }
                if (compTownRad.IsChecked == true)
                {
                    return !string.IsNullOrEmpty(model.CompanyTown) &amp;&amp; model.CompanyTown.Contains(searchBox.Text);
                }
                if (compPcodeRad.IsChecked == true)
                {
                    return !string.IsNullOrEmpty(model.CompanyPcode) &amp;&amp; model.CompanyPcode.Contains(searchBox.Text);
                }
                return false;
            };
        }
    }  



The problem with your code is that each time the text changed you are adding a new Filter to the ICollectionView by using  

view.Filter += (obj) =&gt;  


this little + is doing all the harm. For each raise of the TextChanged event a new filter is added and never removed.  

If you remove the + you will see that your filtering will become faster.  



The problem with A1 vs a1 is that the Contains() method is case sensitive. A better way would be to use IndexOf(string, StringComparison) like so  

return !string.IsNullOrEmpty(model.CompanyName)  
       &amp;&amp; model.CompanyName.IndexOf(searchBox.Text, StringComparison.OrdinalIgnoreCase) &gt; -1;