Goran Bibic

Goran Bibic

  • 474
  • 2.9k
  • 201.1k

Search two words in datagrid C#

May 31 2020 1:27 PM
Regards

I need search two words in datagrid
Example
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.         } 
 

Answers (1)