Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (listBox1.Items.Count == 0)
            {
                MessageBox.Show("Add filter(s) first!");
                return;
            }

            var dt = m_mainForm.DataTable;

            if (m_filter == null)
            {
                m_filter = dt.AsEnumerable();
            }

            if (!checkBox1.Checked)
            {
                m_filter = dt.AsEnumerable();
            }

            var temp = m_filter.AsParallel().AsOrdered().Where(Compare);

            if (temp.Count() != 0)
            {
                m_filter = temp.CopyToDataTable().AsEnumerable();
            }
            else
            {
                m_filter = new DataTable().AsEnumerable();
            }

            m_mainForm.SetDataSource(m_filter.AsDataView());
        }