datagridview里面嵌套 ListBox
private void dgvSetWorkGroup_Click(object sender, EventArgs e)
{
if (dgvSetWorkGroup.CurrentCell.ColumnIndex==4)
{
Rectangle rect = dgvSetWorkGroup.GetCellDisplayRectangle(dgvSetWorkGroup.CurrentCell.ColumnIndex, dgvSetWorkGroup.CurrentCell.RowIndex, false);
ListBox lb = new ListBox();
lb.FormattingEnabled = true;
lb.ItemHeight = 12;

这篇博客介绍了如何在DataGridView的某一列中嵌套一个ListBox。在用户点击特定单元格时,动态创建并填充ListBox,显示数据源`ScanList`的内容。ListBox的选择项在用户离开时会被更新到当前行的第4列,实现数据交互。
最低0.47元/天 解锁文章
1738

被折叠的 条评论
为什么被折叠?



