c# - Set Combo Box in Datagridview Column -


i have datagridview (dgvtable) 2 columns. first column contains combo boxes preset data database. second column text. trying set selection of combo boxes in first column based on information in second.

i simplified code bit need with:

string data = "match variable"; foreach (datagridviewrow row in dgvtable.rows) {     if (match.equals(row.cells[1].value.tostring())) //checking see if second column value matches data     {         row.cells[0].value = "help";            //if second column value == data set combobox selected value "help"     } } 

the combo boxes doesn't show value

edit: started new project , made datagridview , added columncombobox. did set value of combobox successfully. difference trying change datagridview combobox value in separate window. change anything?

dropdownlist ddl = (dropdownlist)e.row.findcontrol("ddlname"); ddl.selectedvalue = "help"; 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -