I have a list which contains the data that is shown in my WPF Datagrid. I have the following code which searches the grid for a match with a textbox entered string. the code is in a button click handler.
var search = from s in dglist // dglist is my List<APerson>
where s.FirstName == textBox1.Text
select new
{
Firstname = s.FirstName,
Lastname = s.LastName
};
dataGrid1.ItemsSource = search;
The last line does not put the resultset in search back into the datagrid, why?