private void buttonTimKiem_Click(object sender, EventArgs e) { string key = txtTimKiem.Text; if (key.Trim() != "") { grcHanghoaSearch.DataSource = HangHoaService.Search(key); } else { grcHanghoaSearch.DataSource = HangHoaService.LoadDataTable(); } }
private void txtTimKiem_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string key = txtTimKiem.Text; if (key.Trim() != "") { grcHanghoaSearch.DataSource = HangHoaService.Search(key); } else { grcHanghoaSearch.DataSource = HangHoaService.LoadDataTable(); } } }