VB.net DataGridView rows with different control types


Is it possible to have a DataGridView with the first row containing Textboxes and the second containing ComboBoxes? If not can you have both as ComboBoxes and make the first one look like a TextBox
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
The DataGridView has been designed so that you define the type of control on the columns, which makes sense, since each column usually displays a given type of data.

So there is no way to do what you want in the DataGridView itself.

You could however simulate what you want by overlaying the cells with standard controls. Simply create standard controls, and give them the same location and size as the cells you want to replace. When the user clicks on a cell, you transfer the cell data in the overlaying control and make it visible. When the user leave the overlaying control, you take its content, transfer it to the cell and hide the overlaying control.
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.