Mayank Jani

Mayank Jani

  • NA
  • 477
  • 76.7k

How to show databound drop down list in a column of DGV?

Oct 16 2018 1:42 AM
Hello,
 
Greetings of the day...
 
I am working on a windows application in C#.
I have a ComboBox (CB) and a DataGridView (DGV). When I select any value from the CB, it adds in the DGV. the row addition in the DGV is done programatically. the DGV contains some more columns and I want to add something like a drop down list or combobox with some data that comes from a data table and I choose the value from it for the cell or column.
 
e.g. the DGV contains columns like Product, Colour, Size etc. When I select a product from the CB, like Shoes, it added into the DGV. Now, there are two more columns i.e. Colour and Size. so, when I click or press enter on the cell, a drop down list or combobox should be open with options like, Red, Black, Green for Colour and 7, 8, 9 for Size. the colour and size comes from a data table.
 
How to achieve these two goals?
 
Thanks a lot.
 
Mayank Jani.
 

Answers (5)