绑定下拉框数据元的链接地址:http://stackoverflow.com/questions/8711182/datagridivew-datagridviewcomboboxcolumn-select-value-member
i have datagridview which has one combobox column. i populate combobox column. when i select any text from combobox column then i need to get the value when i read the data in for loop. dgFilter is here datagridview
here this way i read data from combobox column
but the problem is i am not getting the combox value member rather i am getting display member. so how to extract value member from for loop. please guide me with code. thanks |
绑定selectindexchanged事件的链接地址:http://s.yanghao.org/program/viewdetail.php?i=263596
C# code
//在datagridview的Editing事件里面写privatevoid dataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { ComboBox cb = e.Control as ComboBox; if (cb !=null) { cb.SelectedIndexChanged +=new EventHandler(cb_SelectedIndexChanged); } } void cb_SelectedIndexChanged(object sender, EventArgs e) { //这里执行你需要的,这就是下拉事件}