【发布时间】:2016-07-29 09:19:22
【问题描述】:
我在grivviewDevexpress 中添加了一个CheckedListBoxItem,您可以在此处看到:
如您所见,我在page_load 中初始化数据源:
List<User> confirms = _userRepository.Get().ToList();
ConfirmList.DataSource = confirms;
ConfirmList.DisplayMember = "FullName";
ConfirmList.ValueMember = "Id";
在保存按钮中,我需要获取用户选择的值(多个选择),但它返回 null 为什么?
private void btnSave_ItemClick_1(object sender, ItemClickEventArgs e)
{
gridView.CloseEditor();
Convert.ToDateTime(gridView.GetRowCellValue(rowHandle, "ReturnDateTime"));
CheckedListBoxItem confirms =(CheckedListBoxItem)(gridView.GetRowCellValue(rowHandle, "Confirm"));
}
【问题讨论】:
-
您在“确认”列中存储了什么?正如我从列表的数据源中看到的那样。它应该具有与 User 的 Id 属性相似的数据类型。
-
@NiranjanKala 这是什么意思?我在问题中解释了
标签: c# gridview devexpress