private void TxtBuscar_TextChanged(object sender, EventArgs e) { if (TxtBuscar.Text != "") { DgvCliente.CurrentCell = null; foreach (DataGridViewRow r in DgvCliente.Rows) { r.Visible = false; } foreach (DataGridViewRow r in DgvCliente.Rows) { foreach (DataGridViewCell c in r.Cells) { if ((c.Value.ToString().ToUpper()).IndexOf(TxtBuscar.Text.ToUpper()) == 0) { r.Visible = true; break; } } } } else { ClsNCliente objcli = new ClsNCliente(); DgvCliente.DataSource = objcli.MtdListarTodoCliente(); } }
private void BtnListar_Click(object sender, EventArgs e) { ClsNCliente objcli = new ClsNCliente(); DgvCliente.DataSource = objcli.MtdListarTodoCliente(); }
public void cargarclientes() { ClsNCliente objcli = new ClsNCliente(); DgvCliente.DataSource = objcli.MtdListarTodoCliente(); }