In the code below, i can only filter based on the Surname column in my table, can i filter using more than one table column?
ICollectionView view = CollectionViewSource.GetDefaultView(EmployeeView.ItemsSource);
view.Filter = m => ((EmployeeMaster)m).Surname.ToLower().Contains(TextBoxSearch.Text.ToLower());
You could try combining the conditions via &&
or ||
operators, like this:
ICollectionView view = CollectionViewSource.GetDefaultView(EmployeeView.ItemsSource);
view.Filter = m => ((EmployeeMaster)m).Surname.ToLower().Contains(TextBoxSearch.Text.ToLower()) || ((EmployeeMaster)m).Name.ToLower().Contains(TextBoxSearch.Text.ToLower());