[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 651
  • Last Modified:

VB.net Add items from an array to all ComboBox columns in a DataGridView row

Hi

I need to add the items in an array to all the ComboBox columns in a DataGridView that has over a hundred columns. Is there an easy way to add these items to only row 1 of a ComboBox? What code would I use?

Thanks
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
nepaluzCommented:
Is this related to your last question I responded to? If so, in the CellValidating event, simply cast the cb variable to the first row combobox then add the values to that, e.g
Dim cb = CType(DataGridView1.Item(DataGridView1.CurrentCell.ColumnIndex, 0), DataGridViewComboBoxCell)

Open in new window

Here, you willalways beadding the new values to the first row combo (you may get the error you were getting previously though!)
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much and yes it is related
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now