Rick_Stanich
Technical User
Not wanting to type a long-drawn-out subject, I am new to VB.net, and it's been many many years since I was into VB6.
On Form1 I have a Combobox and a Listbox, Form2 is my DataGridView.
With help from others on forums, I have been able to populate the Combobox with a single column of data from the DataGridView.
I am now trying to understand how to populate a Listbox with a Row of data from the DataGridView based on a selection from the Combobox.
The data going into the Listbox has to be in a single column. I have spent days reading and trying to accomplish this, but I think I am over my head this time.
Are there any tutorials/examples that discuss getting and placing data as I have described?
Not sure if not showing the DataGridView is normal or a hindrance, I prefer it to be hidden (Shown for example only)
All assistance is appreciated.
Rick Stanich
CMM Programming and Consulting
On Form1 I have a Combobox and a Listbox, Form2 is my DataGridView.
With help from others on forums, I have been able to populate the Combobox with a single column of data from the DataGridView.
VB Forum said:
Code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Fill the ComboBox with Distinct Product names from Sheet
ComboBox1.DataSource = ExcelOleDb("V:\CMM Data Files\Micura CMM PCM Programs (252)\Inline Blocks\Parameters.xls", "SELECT Distinct Part FROM [Dimensions$A:BZ]")
ComboBox1.DisplayMember = "Part"
ListBox2.Items.Clear()
'Form2.Show() 'for testing
End Sub
I am now trying to understand how to populate a Listbox with a Row of data from the DataGridView based on a selection from the Combobox.
The data going into the Listbox has to be in a single column. I have spent days reading and trying to accomplish this, but I think I am over my head this time.
Are there any tutorials/examples that discuss getting and placing data as I have described?
Not sure if not showing the DataGridView is normal or a hindrance, I prefer it to be hidden (Shown for example only)
All assistance is appreciated.
Rick Stanich
CMM Programming and Consulting