示例#1
0
 private void BusquedaTB_TextChanged(object sender, EventArgs e)
 {
     if (BusquedaTB.Text != "")
     {
         ClienteDGV.CurrentCell = null;
         //oculta las filas
         foreach (DataGridViewRow r in ClienteDGV.Rows)
         {
             r.Visible = false;
         }
         //muestra la busqueda
         foreach (DataGridViewRow r in ClienteDGV.Rows)
         {
             foreach (DataGridViewCell c in r.Cells)
             {
                 if ((c.Value.ToString().ToUpper()).IndexOf(BusquedaTB.Text.ToUpper()) == 0)
                 {
                     ClienteDGV.ClearSelection();
                     r.Visible = true;
                     break;
                 }
             }
         }
     }
     else
     {
         cargarDatos();
     }
 }