private void btnTimKiem_Click(object sender, EventArgs e) { string key = txtKHTTSearch.Text; if (key.Trim() != "") { grcKHTTSearch.DataSource = KhachHangThanThietService.Search(key); } else { grcKHTTSearch.DataSource = KhachHangThanThietService.LoadDataTable(); } }
private void txtKHTTSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string key = txtKHTTSearch.Text; if (key.Trim() != "") { grcKHTTSearch.DataSource = KhachHangThanThietService.Search(key); } else { grcKHTTSearch.DataSource = KhachHangThanThietService.LoadDataTable(); } } }