0

I want to make a search in a datagrid with the text "Modele" but it takes only the upper case or lower case according to the text to search. i want that it show me the "Modele" regardless of upper or lower case.enter image description here

This is what i try:

  private void textBox_model_TextChanged(object sender, EventArgs e)
{

    string searchValue = textBox_model.Text;

    for (int u = 0; u < dataGridView_Articles.RowCount; u++)
    {
        if (dataGridView_Articles.Rows[u].Cells[5].Value.ToString().Contains(searchValue))
        {
            dataGridView_Articles.Rows[u].Visible = true;
        }
        else
        {
            dataGridView_Articles.Rows[u].Visible = false;
        }
    }            
}
Medbouk
  • 23
  • 3

1 Answers1

0

Just change this:

string searchValue = textBox_model.Text;

to this:

string searchValue = textBox_model.Text.ToLower();
Rob
  • 11,492
  • 14
  • 59
  • 94