Dev中多选下拉框获取选中项

Dev中多选下拉框CheckedComboBoxEdit控件,获取选中项

 

方法1,遍历所有选项,判断是否选中

BaseInfo = this.Orientation.Properties.Items
.Where(m => m.CheckState == CheckState.Checked)
.Select(m => new OrientationListModel()
{
OrientationId = int.Parse(m.Value.ToString()),
OrientationName = m.Description,
}).ToList();

 

方法2,获取选中的ID集合

string ids = this.Decoration.Properties.GetCheckedItems().ToString();

 

方法3,只有文本集合

string AreaID = cbx_areas.Text

posted @ 2018-10-31 14:36  坑主  阅读(817)  评论(0编辑  收藏  举报