Ajeet Singh

Ajeet Singh

  • NA
  • 193
  • 18.8k

Search DataTable when checkedListbox items are checked

Jun 10 2019 4:44 AM
 
I want to search the DataTable where column paymentMode == checkedListBox.checked item text.  
 
DataTable table = dataTableRegister.Clone();
DataRow row;
foreach (string s in checkedListBox.CheckedItems)
{
foreach (DataRow dr in datatableRegister.Select("PayMode = s"))
{
table.Rows.Add(dr);
}
}
DataGridView1.DataSource = table;

Answers (4)