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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -