I am trying to initialize a DataGridView to be 12 columns by 15 rows (with labels) and them all be combo boxes. Later on in the code I plan to populate each drop down with items from a single array called
names(). But I cannot even get past the load code.
Also, any chance I can get an example or some hooks on how I would later add the
names() array to each combo box? I want to press a button that runs a REGEX to extract values from a text file for the array.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load DataGridView1.RowHeadersWidth = 50 Dim comboBoxCell As New DataGridViewComboBoxCell For row As Integer = 0 To 14 Dim i As Integer = DataGridView1.Rows.Add() DataGridView1.Rows(i).HeaderCell.Value = (i + 1).ToString() For col As Integer = 0 To 11 DataGridView1(col, row) = comboBoxCell Next Next End Sub Private Sub RefreshButton_Click(sender As Object, e As EventArgs) Handles RefreshButton.Click '***** REGEX code to extract name values from text file add to array called names() ***** '***** some more code to enumerate DataGridView1 combo boxes with names() array ***** End Sub