c# - How do I populate a DatagridViewComboboxColumn -
i not sure how populate datagridviewcomboboxcolumn. there several properties in datagridviewcomboboxcolumn, , not sure use:
- datasource
- items
- displaymember
- valuemember
i confused there many properties. tried:
datagridviewcomboboxcolumn cb = (datagridviewcomboboxcolumn)datagridview1.rows[0].cells[0].value; cb.items.add("test"); //or cb.datasource = new list<string>() { "t", "e", "s", "t" };
you have cast datagridviewcomboboxcell
, not datagridviewcomboboxcolumn
:) example:
((datagridviewcomboboxcell)datagridview1.rows[0].cells[0]).items.add("something");
Comments
Post a Comment