|
-
Aug 1st, 2012, 03:11 PM
#10
Thread Starter
Member
Re: Working with datagridview
 Originally Posted by samuelk
I still don't understand where you're getting the code from, but to populate the ComboBox, you would do something like this:
vb Code:
Dim i As Integer For i = 0 To DataGridView1.RowCount - 1 If DataGridView1.Rows(i).Cells("WhateverTheCodeColumnIsNamed").Value.ToString = "TP8" Then ComboBox1.Items.Add(DataGridView1.Rows(i).Cells("StoreNumber").Value.ToString) End If Next
And then when a selection is made in the ComboBox you could iterate through the DataGridView again until you find the matching row and then set the value of the two TextBoxes to the value of the corresponding DataGridView cells.
There's probably a better way to do it, but that would work.
Works like a charm! Thanks. And how would I have the StoreNumber refernced in the ComboBox bring the associated City and State with it?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|