Hello All,
i have a query regarding add rows dynamically in datagridview .I need to have a datagridview which contains 4 columns as follows:
Column headers : Test1 ,Test2, Test3, Test4 (Creation of columns is also dynamic)
Test1 ,Test2 and Test3 are of type DataGridViewComboBoxColumn and Test4 of type DataGridViewTextBoxColumn
Example: Suppose i have 4 rows in datagridview everytime the 1 and last row(4) under Test1 should have combo box items same and 2nd and 3rd have same data
Test1 Test2 Test3 Test4
items(1,2) items(5,5) items(6,7) first
items(4,5) items(5,5) items(6,7) first
items(4,5) items(5,5) items(6,7) first
items(1,2) items(5,5) items(6,7) first
Please help me in this regard.
Thanks & Regards,
Sampath
What I have tried:
'DataGridView1.Rows.Add()
'Dim cmb As New DataGridViewComboBoxColumn()
'Dim cmb1 As New DataGridViewComboBoxColumn()
'Dim cmb2 As New DataGridViewComboBoxColumn()
'Dim txtbox As New DataGridViewTextBoxColumn()
'Dim cmbOthers As New DataGridViewComboBoxColumn()
' For i = 0 To 3
'cmb.HeaderText = "Select Data"
'cmb.Name = "cmb"
'cmb.MaxDropDownItems = 4
'cmb.Items.Add("1/3")
'cmb.Items.Add("1/2")
'DataGridView1.Columns.Add(cmb)
'cmb1.HeaderText = "Select Data1"
'cmb1.Name = "cmb1"
'cmb1.MaxDropDownItems = 4
'cmb1.Items.Add("True")
'cmb1.Items.Add("False")
'DataGridView1.Columns.Add(cmb1)