AlHal2
asked on
change type of the selected cell on datagridview when cell is clicked.
I am populating a datagridview with two text columns from the output of a sql stored procedure. I want the user to be able to click on any cell in the grid and see a drop down list of values populated from another database table, one per each column, which they can select from to override the cell content from the initial datasource. i.e I want to change the type of the selected cell from datagridviewtextboxcolumn to datagridviewcomboboxcolumn when the cell is clicked. Is there any way of doing this?
Yuu cannot change type of a datagridview cell, this is not possible. You would need to add comboboxcolumn (have it visible = false, copy data from textboxcell to new comboboxcell, remove textboxcell, and make comboboxcolumn visible.
ASKER
Do you have any sample code for this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
ASKER
The text property of the combobox are the contents of the data table.
At the moment each cell of the grid is like a textbox and is populated by the contents of the data table.