.net - Create custom list view in windows form with c# -


i facing issues in creating custom list view in windows forms c#. in listview want 1 cell text box , 3 cell drop down box or combo box , 1 cell image button. tried make gridview , taking cell combobox not able bind data specific combobox database. tried creating cell coding making false auto generate column still not able bind data combobox in grid view.

my code:

private void form1_load(object sender, eventargs e) {     sqlconnection db = new              sqlconnection(configurationmanager.connectionstrings["ram"].connectionstring);     db.open();     // string query = @"select itemcode item";     sqlcommand command = new sqlcommand("select itemcode item", db);     sqldataadapter adapter = new sqldataadapter(command);     datatable dt = new datatable();     adapter.fill(dt);     datagridviewcomboboxcolumn cmb = new datagridviewcomboboxcolumn();     //cmb.headertext = "";     cmb.name = "itemcode";     //cmb.maxdropdownitems = 4;     cmb.items.add("");     //cmb.items.add("false");     datagridview1.columns.add(cmb);  } 

how can achieve this?

datagridviewcomboboxcolumn adding not have items in it. try binding value presents in combobox items.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -