如何从DataGridView中查找相同的数据

时间:2017-03-07 17:33:13

标签: c# excel datagridview

我在DataGridView上写数据,我想在DataTable上计算和列出相同的数据,但我没有找到如何做到这一点。请帮忙!

string no;
        foreach (DataGridViewRow r in dataGridView1.Rows)
        {
            if (r.Cells["cNumber"].Value == null || r.Cells["cNumber"].Value.Equals(""))
            {
                continue;
            }

            no = r.Cells["cNumber"].Value.ToString();



            if (no == null || ValidateNmbr(no) == false)
            {
                r.Cells["nmbControl"].Value = "False";
            }
            else
            {
                r.Cells["nmbControl"].Value = "True";
            }

            if (r.Cells["cNumber"].Value != null)
            {

(ValidateNmbr(字符串号)是特定功能)

0 个答案:

没有答案