VB.NET 2005 DataGridView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NaasDup
    New Member
    • Feb 2008
    • 3

    VB.NET 2005 DataGridView

    Hi

    I have to read a CSV file in with 6 columns of data. The last column contains values delimited by & eg.
    "Lastname","Fir stName","Zip"," Phone","Area"," 001&002%008&012 "

    There are 100's of these rows in this CSV file. I have created a DGV with the type in the last column set to ComboBox and I have parsed the last column into a String array.

    Question I have is, how do I load the contents of that array into the Combobox?

    I have tried this but it does not work.

    Code:
    Dim comboboxColumn As New DataGridViewComboBoxCell
    
    Temp2 = Split(Temp1, "&", , CompareMethod.Text)
    
    For I = 0 To Temp2.GetLength(0) - 1
      comboboxColumn.Items.Add(Temp2(I))
    Next
    DGV1.Rows(myRowCounter).Cells("colCodes") = comboboxColumn
    Any help would be appreciatted.

    Thanks
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    You are not iterating the i, usually done using i++. HTH.

    Comment

    • NaasDup
      New Member
      • Feb 2008
      • 3

      #3
      Hi

      This is VB not C# . FOR - NEXT loops.
      Maybe I need to be more specific. The above FOR loop works loading the array items in the define d combobox but not the part where I assign the box to a particular cell.

      DGV1.Rows(myRow Counter).Cells( "colCodes") = comboboxColumn

      This is the part that is not working - listing the data in the DGV cell's combobox.

      Comment

      Working...