Thank all you for last replies
here i hve a problem in my project .
I have 2 form . In frm1 i have a datagridview which contain all information of student i.e ID, NAME , CLASS No. , ADDRESS , Department and course .
In this form i hve 2 button New and Edit.
The 2nd form is Edit form which contain ID(txtbox), NAME(txtbox) , CLASS No.(txtbox) , ADDRESS(txtbox) , Department(combobox) and course(combobox) .
Departmen and course combobox pickup data from database.
Now
when the user click the edit button Edit_form will open and it fill all field. I try a code below it fill all feild but not select the correct combobox index i.e i select a row with deptment computer when i click the edit button the editform open , it automaticly select the computer in department combobox.
Code
dim frmedit as new form_Edit
Dim i As
Integer
i =
DataGridView1.
CurrentRow.Index
frm.textbox1.Text
= DataGridView1.
Item(0, i).Value
frm.TextBox2.
Text =
DataGridView1.
Item(1, i).Value
frmedit.TextBox3.
Text =
DataGridView1.
Item(2, i).Value
frmedit.CmbDEP.
Text =
DataGridView1.
Item(3, i).Value
it show the 'computer' department in combobox. But not selecting the 'computer' index.
I need how i retrive the correct index of computer
plz help