【发布时间】:2011-07-19 01:29:29
【问题描述】:
嗨,我在运行时将数据绑定到 datagridview 组合框。但是我如何让它自动显示第一个项目?我无法从 DataGridViewComboBoxColumn 中找到 selectedindex。
DataGridViewComboBoxColumn cbStudentCourse = (DataGridViewComboBoxColumn)dgStudentCourse.Columns["studentCourseStatus"];
cbStudentCourse.DataSource = Enum.GetValues(typeof(CourseStudentStatus));
cbStudentCourse.DisplayIndex = 1;
-- 更新 ---
我在解决方案 3 中看到有人这样做
LInk
你确定我需要这么长的代码才能选择第一个项目??????
【问题讨论】:
标签: c# winforms gridview datagridviewcombobox