I populate a DGV with 4 columns (using a DataTable) on the fly and would like to make column 2 and 3 a combo box.
Data Returned values:
ProjNum(1) = H-16-0001, StatusCode(2) = P, ActionCode(3) = C, and ActionSeqnum(4) = 0001
For status code and action code we have a look up tables:
P = Pending
C = Create
For each row I would like to have column 2 and 3 as a combo box and set itself to what the returned value is and the text 'Pending/Create'.
DataGridView1.DataSource = ClassName.GetAppData(); //Returns a datatable.
How would I get the DGV columns 2 & 3 to display as a combo box?
I have found a link and tried: DataGridView set column cell Combobox
and also have found the CellFormatting event but I can't seem to get it working.
I created functions for the look up tables which returns a data table but when trying to bind it using the methods above, I can't get it to work.
Coming from a PowerBuilder back ground, the .NET controls and functionality is new to me.
Thank you for your help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…