Solved

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

Posted on 2012-04-09
2
633 Views
Last Modified: 2012-04-09
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
Comment
Question by:murbro
2 Comments
 
LVL 17

Accepted Solution

by:
nepaluz earned 500 total points
ID: 37825174
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
 

Author Closing Comment

by:murbro
ID: 37825216
Thanks very much and yes it is related
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Starting to learn JAVA, 7 48
How to trouble shoot .net contact form 3 30
Encryption Decryption in Oracle 12 61
Hide Tab Page 3 19
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now