[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2012-04-09
2
Medium Priority
?
645 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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 …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 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