Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 775.4k

Display ComboBox SelectedItem in DataGridView

Jul 12 2013 2:29 PM
Sir, I am now working on a ADO.NET Project.

It has a form named  frmmarkEntry.

Here is frmMarkEntry



You can see Four comboBox in this form. It represent another forms and tables, Form Class(frmClass) See one among those tables.


Here is frmClass;




you can see that the className from frmclass is been passed to the comboBox in frmMarkEntry.

Like that I have another three  forms, frmDivision , frmExam and frmSubject You can guess what the other three comboBoxes represents in frmMarkEntry .


please take a look to the function I coded to load the className to the comboBox;

public void cmbclassFill()
        {
            classSp spclass = new classSp();
            DataTable sqlDt = new DataTable();
            sqlDt = spclass.classviewAll();
            DataRow DR = sqlDt.NewRow();
            DR[1] = "-SELECT-";
            sqlDt.Rows.InsertAt(DR, 0);
            cmbClass.DataSource = sqlDt;
            cmbClass.ValueMember = "classId";
            cmbClass.DisplayMember = "className";
           
           
        }

My Task from this form is:-

display className in datagridView1 in frmMarkEntry.

what should I do to this task?

reply please.