Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi i am using window application and datagridview in it DGV is populated to a database table (patient_name,Test_Name,Result,Reference_Ranges).I want when the Result column receive input focus a combo box appear and user select value from it but want the combo box not for all cell of the result column because in some situation the user inter the value from keyboard because the combo box is read only and data source of that combo box is bond to database and select defrent value for each test ;
in short i want like this
DGV.rows[e.rowindex].cells["Result"].controls.add(cmb);

i tried the best and search the net but fail
i add the cmb like this
DGV.controls.add(cmb);

but it appear at the top of DGV and i want it specific result column cell which receive input focus.
help me withe some sample of code
thanks
Posted

1 solution

Try This

C#
DataGridViewComboBoxColumn c = new DataGridViewComboBoxColumn();
dataGridView1.Columns.Add(c);
 
Share this answer
 
Comments
sher ali 15-May-11 12:27pm    
dear i have already tried this but this adds a new column which i do not want. i want a textboxcolumn some cells to be act as a combobox not all cells.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900