0
Answer

Display ComboBox SelectedItem in DataGridView

Bineesh  VP

Bineesh VP

11y
1.1k
1
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.