c# - How to get value from datagridview combobox? -


how value datagridview combobox after selected value changed?

you can use:

var value = datagridview.rows[0].cells[0].value 

note: supply correct row , cell number.

or can if bound object listitem

string value = datagridview.rows[rowindex].cells[columnindex].value.tostring();  if datagridview.rows[rowindex].cells[columnindex] datagridviewcomboboxcell && !string.isnullorempty(value)) {      list<listitem> items = ((datagridviewcomboboxcelldatagridview.rows[rowindex].cells[e.columnindex]).items.cast<listitem>().tolist();      listitem item = items.find(i => i.value.equals(value)); } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -