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

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -