Exemplo n.º 1
0
        private void BtnFilter_Click(object sender, EventArgs e)
        {
            FrmSearchResult frm = new FrmSearchResult();

            for (int i = 0; i < dgStudent.Rows.Count; i++)
            {
                DataGridViewRow r = dgStudent.Rows[i];
                if (r.Cells[4].Value.ToString().Equals(cbNationalFilter.Text))
                {
                    frm.AddStudentInfo(r.Cells[0].Value.ToString(),
                                       r.Cells[1].Value.ToString(), r.Cells[2].Value.ToString(),
                                       r.Cells[3].Value.ToString(), r.Cells[4].Value.ToString(),
                                       r.Cells[5].Value.ToString(), r.Cells[6].Value.ToString(),
                                       r.Cells[7].Value.ToString());
                }
            }
            frm.ShowDialog();
        }
Exemplo n.º 2
0
        void SearchbyName()
        {
            FrmSearchResult frm = new FrmSearchResult();

            for (int i = 0; i < dgStudent.Rows.Count; i++)
            {
                DataGridViewRow r = dgStudent.Rows[i];
                if (r.Cells[1].Value.ToString().IndexOf(txtName.Text) > -1)
                {
                    frm.AddStudentInfo(r.Cells[0].Value.ToString(),
                                       r.Cells[1].Value.ToString(), r.Cells[2].Value.ToString(),
                                       r.Cells[3].Value.ToString(), r.Cells[4].Value.ToString(),
                                       r.Cells[5].Value.ToString(), r.Cells[6].Value.ToString(),
                                       r.Cells[7].Value.ToString());
                }
            }
            frm.ShowDialog();
        }