I am trying to search by name and by address in my datagridview the code is like below
private void txtSearch_TextChanged(object sender, EventArgs e)
{
string searchText = txtSearch.Text.ToLower();
List<EmplyesList> result = LoginData.employees.Where(t => t.FullName.ToLower().StartsWith(searchText)
|| t.Address.ToLower().StartsWith(searchText)).ToList();
dgvEmployeeList.AutoGenerateColumns = false;
dgvEmployeeList.DataSource = result;
}
But when i try to search in the text box by writing a character it just clears the rows and doesnt show nothing .
I just cant see the problem that i am having