Goran Bibic

Goran Bibic

  • 694
  • 2.3k
  • 59.3k

Search two words in datagrid C#

May 31 2020 1:27 PM

I need search two words in datagrid
If is team AC MILAN
If put word MILAN in text box have multiple values, becose I have basketbal team and footbal team

Need some solution LIKE: %AC%MILAN% (Result find all word in datagrid with AC and MILAN)
  1. private void SearchListTextBox_TextChanged(object sender, EventArgs e)  
  2.         {  
  3.             (ListDataGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("[Team] LIKE '%{0}%' OR [Player] LIKE '%{0}%'", SearchListTextBox.Text);  
  4.             countRowsLabel.Text = "Ukupno racuna: " + ListDataGridView.RowCount.ToString();  
  5.         } 

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)