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
Post a Comment