?
Solved

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

Posted on 2012-04-09
2
Medium Priority
?
643 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
nepaluz earned 2000 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:Murray Brown
ID: 37825216
Thanks very much and yes it is related
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 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